#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from gnm(GNOME Desktop Environment)" \
  --checklist "select packages from gnm series. \
You can move cursor with UP/DOWN key and push space \
key to select pkgs. After finish selecting, \
push Enter to start installation. " 24 72 15 \
"PolicyKit_gnome" "Policykit tools for GNOME" "off" \
"desktop" "GNOME/desktop" "off" \
"ekiga" "ekiga soft phone" "off" \
"empathy" "empathy インターネットメッセンジャー" "off" \
"fifth-toe" "GNOME/fifth-toe" "off" \
"gconf_tree" "gconf configuration data" "off" \
"geektoys" "GNOME/geektoys" "off" \
"gnome_common" "GNOME project common headers" "off" \
"gnome_mime_data" "GNOME MIME data" "off" \
"guile" "Guile (GNU's Ubiquitous Intelligent Language for Extensions)" "off" \
"libbonobo" "libbonobo" "off" \
"libbonoboui" "libbonoboui" "off" \
"libgnome" "libgnome" "off" \
"libgnomecanvas" "libgnomecanvas" "off" \
"libgnomeui" "libgnomeui" "off" \
"mono" "Common Language Runtime: Mono" "on" \
"office" "GNOME/office" "off" \
"swf" "free swf decoder/player" "off" \
"yelp" "GNOME Help system" "off" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in PolicyKit_gnome desktop ekiga empathy fifth-toe gconf_tree geektoys gnome_common gnome_mime_data guile libbonobo libbonoboui libgnome libgnomecanvas libgnomeui mono office swf yelp  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in PolicyKit_gnome desktop ekiga empathy fifth-toe gconf_tree geektoys gnome_common gnome_mime_data guile libbonobo libbonoboui libgnome libgnomecanvas libgnomeui mono office swf yelp  ; 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
