#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "tex(TeX Text Typesetting system)シリーズの選択"   --checklist "texシリーズの中からインストールしたいパッケージを 選んでください．カーソルの上下キーで 対象を選択し，space キーでマーク(X)します． Enter キーでインストールを開始します．" 24 72 15 "texlive" "texlive" "on" \
"texlive_texmf1" "texlive_texmf1" "on" \
"texlive_texmf2" "texlive_texmf2" "on" \
"texlive_texmf3" "texlive_texmf3" "on" \
"texlive_texmf4" "texlive_texmf4" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in texlive texlive_texmf1 texlive_texmf2 texlive_texmf3 texlive_texmf4  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in texlive texlive_texmf1 texlive_texmf2 texlive_texmf3 texlive_texmf4 ; do
    if grep "$PACKAGE" /tmp/SeTpkgs 1> /dev/null 2> /dev/null ; then
        echo "$PACKAGE: ADD" >> /tmp/SeTnewtag
    else echo "$PACKAGE: SKP" >> /tmp/SeTnewtag
    fi
done
rm -f /tmp/SeTpkgs

