#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "emacs(Emacs environment)シリーズの選択" \
  --checklist "emacs シリーズの中からインストールしたいパッケージを \
選んでください．カーソルの上下キーで \
対象を選択し，space キーでマーク(X)します． \
Enter キーでインストールを開始します．" 24 72 15 \
"apel" "Emacs互換性向上ライブラリ" "on" \
"ddskk" "Daredevil SKK" "on" \
"egg" "日本語入力メソッド" "on" \
"eggcanna" "egg-canna.el" "on" \
"eggremix" "多言語入力用フロントエンド" "on" \
"emacs" "多機能エディタ" "on" \
"emacs_w3m" "Emacs 用 WWW ビューワ" "on" \
"mew" "日本語メーラ" "on" \
"navi2ch" "Emacs 用 2ch ビューワ" "on" \
"skk_dics" "SKK用辞書" "on" \
"skkfep" "SKK 風の漢字入力フロントエンド" "on" \
"yatex" "野鳥：Yet Another Tex mode" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in apel ddskk egg eggcanna eggremix emacs emacs_w3m mew navi2ch skk_dics skkfep yatex  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in apel ddskk egg eggcanna eggremix emacs emacs_w3m mew navi2ch skk_dics skkfep yatex  ; 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
