#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "nfs(nfs related packages)シリーズの選択" \
  --checklist "nfs シリーズの中からインストールしたいパッケージを \
選んでください．カーソルの上下キーで \
対象を選択し，space キーでマーク(X)します． \
Enter キーでインストールを開始します．" 24 72 15 \
"libevent" "イベント通期機能ライブラリ libevent" "on" \
"libnfsidmap" "NFS id map用ライブラリ libnfsidmap" "on" \
"nfs_utils" "NFS用ユーティリティ集 nfs_utils" "on" \
"rpcbind" "RPCポート管理用デーモン rpcbind" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in libevent libnfsidmap nfs_utils rpcbind  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in libevent libnfsidmap nfs_utils rpcbind  ; 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
