#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from base(Plamo Base system)" \
  --checklist "select packages from base 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 \
"aaa_base" "Basic Linux file system package" "on" \
"acl" "ACL tool" "on" \
"apmd" "APM management tool apmd" "on" \
"at" "at" "on" \
"attr" "attr control tool" "on" \
"bash" "GNU bash" "on" \
"bzip2" "bzip2" "on" \
"coreutils" "GNU coreutils" "on" \
"cracklib" "cracklib" "on" \
"dcron" "Dillon cron" "on" \
"device_mapper" "device-mapper" "on" \
"devs" "device files" "on" \
"dhcp" "ISC DHCP" "on" \
"dosfstools" "dosfstools" "on" \
"dump" "dump" "on" \
"e2fsprogs" "ext2/ext3 fs utiles" "on" \
"ed" "ed" "on" \
"eject" "eject" "on" \
"etc" "configuration files for /etc directory" "on" \
"extipl" "a partition-selectable boot loader/installer for IBM compatible" "on" \
"file" "file" "on" \
"findutils" "GNU find utility" "on" \
"gawk" "gawk(GNU AWK)  with multibyte extension" "on" \
"glibc" "shared library of Glibc2" "on" \
"grep" "GNU grep" "on" \
"groff" "groff with JP patch" "on" \
"grub" "GRUB : GRand Unified Boot loader" "on" \
"gzip" "GNU zip compression utilities." "on" \
"hdsetup" "Slackware setup/management packages" "on" \
"hibernate_script" "hibernation script" "on" \
"iproute2" "Advanced Networking Tools iproute2" "on" \
"kbd" "kbd" "on" \
"kernel" "Linux kernel 2.6" "on" \
"less" "less" "on" \
"libcap" "Libcap - Library to allow POSIX 1e capabilities" "on" \
"libgcc" "GCC basic libraries" "on" \
"lilo" "LILO /the LInux Loader" "on" \
"linux_pam" "Linux PAM" "on" \
"logrotate" "logroate" "on" \
"lvm2" "lvm2" "on" \
"man" "man" "on" \
"mdadm" "mdadm" "on" \
"module_init_tools" "module-init-tools" "on" \
"ncurses" "ncurses  libraries" "on" \
"net_tools" "network commands" "on" \
"netkit_combo" "network programs" "on" \
"nvi" "nvi(new vi)" "on" \
"openssh" "OpenSSH" "on" \
"openssl" "OpenSSL" "on" \
"pciutils" "pciutils" "on" \
"pcmciautils" "PCMCIA control system" "on" \
"planet" "Planet-4.0.0" "on" \
"pmount" "Policy mount" "on" \
"procinfo" "procinfo" "on" \
"procps" "procps" "on" \
"readline5" "GNU readline library" "on" \
"reiserfs" "reiserfs-progs" "on" \
"sed" "GNU sed" "on" \
"shadow" "Shadow password program" "on" \
"sudo" "sudo" "on" \
"sysfsutils" "sysfs utils" "on" \
"sysklogd" "Sysklogd" "on" \
"syslinux" "syslinux" "on" \
"sysvinit" "SysVinit" "on" \
"tar" "GNU tar" "on" \
"tcp_wrappers" "TCP wrapper tools" "on" \
"tcpip" "TCP/IP network configuration files" "on" \
"tcsh" "tcsh with Japanese extentions" "on" \
"tcsh_catalogs" "Japanese Catalog files for Tcsh" "on" \
"udev" "udev" "on" \
"unicon" "unicon" "on" \
"util_linux_ng" "util-linux-ng" "on" \
"zlib" "zlib" "on" \
"zoneinfo" "zoneinfo-2003e + configuration commands" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in aaa_base acl apmd at attr bash bzip2 coreutils cracklib dcron device_mapper devs dhcp dosfstools dump e2fsprogs ed eject etc extipl file findutils gawk glibc grep groff grub gzip hdsetup hibernate_script iproute2 kbd kernel less libcap libgcc lilo linux_pam logrotate lvm2 man mdadm module_init_tools ncurses net_tools netkit_combo nvi openssh openssl pciutils pcmciautils planet pmount procinfo procps readline5 reiserfs sed shadow sudo sysfsutils sysklogd syslinux sysvinit tar tcp_wrappers tcpip tcsh tcsh_catalogs udev unicon util_linux_ng zlib zoneinfo  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in aaa_base acl apmd at attr bash bzip2 coreutils cracklib dcron device_mapper devs dhcp dosfstools dump e2fsprogs ed eject etc extipl file findutils gawk glibc grep groff grub gzip hdsetup hibernate_script iproute2 kbd kernel less libcap libgcc lilo linux_pam logrotate lvm2 man mdadm module_init_tools ncurses net_tools netkit_combo nvi openssh openssl pciutils pcmciautils planet pmount procinfo procps readline5 reiserfs sed shadow sudo sysfsutils sysklogd syslinux sysvinit tar tcp_wrappers tcpip tcsh tcsh_catalogs udev unicon util_linux_ng zlib zoneinfo  ; 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
