#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "Xwindow2(classical X11 system apps)シリーズの選択" \
  --checklist "Xwindow2 シリーズの中からインストールしたいパッケージを \
選んでください．カーソルの上下キーで \
対象を選択し，space キーでマーク(X)します． \
Enter キーでインストールを開始します．" 24 72 15 \
"appres" "appres" "on" \
"beforelight" "beforelight" "on" \
"bitmap" "bitmap" "on" \
"editres" "editres" "on" \
"gccmakedep" "gccmakedep" "on" \
"ico" "ico" "on" \
"imake" "imake" "on" \
"listres" "listres" "on" \
"makedepend" "makedepend" "on" \
"rendercheck" "rendercheck" "on" \
"rgb" "rgb" "on" \
"rstart" "rstart" "on" \
"scripts" "scripts" "on" \
"viewres" "viewres" "on" \
"xdbedizzy" "xdbedizzy" "on" \
"xditview" "xditview" "on" \
"xedit" "xedit" "on" \
"xgc" "xgc" "on" \
"xkbprint" "xkbprint" "on" \
"xlogo" "xlogo" "on" \
"xmag" "xmag" "on" \
"xman" "xman" "on" \
"xmh" "xmh" "on" \
"xmore" "xmore" "on" \
"xorg_cf_files" "xorg_cf_files" "on" \
"xorg_sgml_doctools" "xorg_sgml_doctools" "on" \
"xscope" "xscope" "on" \
"xsm" "xsm" "on" \
"xstdcmap" "xstdcmap" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in appres beforelight bitmap editres gccmakedep ico imake listres makedepend rendercheck rgb rstart scripts viewres xdbedizzy xditview xedit xgc xkbprint xlogo xmag xman xmh xmore xorg_cf_files xorg_sgml_doctools xscope xsm xstdcmap  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in appres beforelight bitmap editres gccmakedep ico imake listres makedepend rendercheck rgb rstart scripts viewres xdbedizzy xditview xedit xgc xkbprint xlogo xmag xman xmh xmore xorg_cf_files xorg_sgml_doctools xscope xsm xstdcmap  ; 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
