#!/bin/sh
find_package() { basename `/bin/ls -1 *.tgz | grep "^$1-"` .tgz; }
#item   ####description                                      ###on off ###
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]
then
   mkdir -p $TMP
fi
cat /dev/null > $TMP/SeTnewtag
dialog --title "SELECTING PACKAGES FROM SERIES A (BASE LINUX SYSTEM)" \
       --checklist "Please select the packages you wish to install \
from series A. Use the \
UP/DOWN keys to scroll through the list, and the SPACE key to select \
the packages you wish to install. Certain important packages have \
already been selected for you, and you are cautioned against unselecting \
these packages. However, it's your system. :^)  For instance, be sure to \
install SILO or you won't be able to boot your system. \
Press ENTER when you are \
done." 21 72 8 \
"aaa_base" "Basic filesystem, shell, and utils - REQUIRED" "on" \
"bash" "GNU bash-2.04 shell - REQUIRED" "on" \
"bash1" "GNU bash-1.14.7 shell" "on" \
"bin" "Various system utilities - REQUIRED" "on" \
"bzip2"  "bzip2 compression utility" "on" \
"cpio" "The GNU cpio backup/archiving utility" "on" \
"cxxlibs" "C++ shared libraries - REQUIRED" "on" \
"devfsd" "daemon for managing devfs - RECOMMENDED" "on" \
"devs" "Device files found in /dev - REQUIRED" "on" \
"e2fsprog" "Utilities for the ext2 file system" "on" \
"elflibs" "Various ELF libraries - REQUIRED" "on" \
"elvis" "elvis text editor (vi clone) - REQUIRED" "on" \
"etc"  "System config files & utilities - REQUIRED" "on" \
"fileutls" "GNU file utilities - REQUIRED" "on" \
"find" "GNU findutils" "on" \
"floppy" "Utilities for using DOS floppies" "on" \
"getty_ps" "Getty_ps serial login support - OPTIONAL" "off" \
"glibcso" "Runtime glibc support libraries" "on" \
"gpm" "Cut and paste text with your mouse" "on" \
"grep" "GNU grep searching tool - REQUIRED" "on" \
"gzip"  "GNU zip compression utility - REQUIRED" "on" \
"hdsetup" "Slackware setup scripts - REQUIRED" "on" \
"infozip" "zip/unzip archive utilities" "on" \
"kbd" "Change keyboard and console mappings" "on" \
"ldso" "Dynamic linker/loader - REQUIRED" "on" \
"less" "A text pager utility - REQUIRED" "on" \
"lpr" "BSD lpr - printer spooling system" "on" \
"minicom" "Serial transfer and modem comm package" "on" \
"modules" "Linux device driver modules -- REQUIRED" "on" \
"modutils" "Kernel module utilities - REQUIRED" "on" \
"ossllibs" "OpenSSL shared libraries - REQUIRED" "on" \
"pciutils" "Linux PCI utilities" "on" \
"procps" "Displays process info - REQUIRED" "on" \
"reiserfs" "Utilities for a journaling filesystem" "on" \
"sh_utils" "GNU shell utils - REQUIRED" "on" \
"shadow" "Shadow password suite - REQUIRED" "on" \
"silo" "SPARC Improved LOader - REQUIRED" "on" \
"sparcutils" "SPARC platform utilities - REQUIRED" "on" \
"sysklogd" "Logs system and kernel messages" "on" \
"sysvinit" "System V-like INIT programs - REQUIRED" "on" \
"tar" "GNU tar archive utility - REQUIRED" "on" \
"tcsh" "Extended C shell /bin/tcsh" "on" \
"txtutils" "GNU text utils - REQUIRED" "on" \
"umsprogs" "Utilities needed by the UMSDOS filesystem" "on" \
"util" "Util-linux utilities - REQUIRED" "on" \
"vmlinux" "Linux 2.2.20pre2 kernel - REQUIRED" "on" \
"zoneinfo" "Configures your time zone" "on" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]
then
   rm -f $TMP/SeTpkgs
   >  $TMP/SeTnewtag
   for pkg in aaa_base bash bash1 bin bzip2 cpio cxxlibs devfsd devs \
              e2fsprog elflibs elvis etc fileutls find floppy getty_ps \
              glibcso gpm grep gzip hdsetup infozip kbd ldso less \
              lpr minicom modules modutils ossllibs pciutils procps reiserfs \
              sh_utils shadow silo sparcutils sysklogd sysvinit tar tcsh \
              txtutils umsprogs util vmlinux zoneinfo
   do
 #     rpkg="`find_package $pkg`"
 #     echo "$rpkg: SKP" >> $TMP/SeTnewtag
  echo "$pkg: SKP" >> $TMP/SeTnewtag
   done
   exit
fi
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in kernel aaa_base bash bash1 bin bzip2 cpio cxxlibs devfsd devs \
               e2fsprog elflibs elvis etc fileutls find floppy getty_ps \
               glibcso gpm grep gzip hdsetup infozip kbd ldso less \
               lpr minicom modules modutils ossllibs pciutils procps reiserfs \
               sh_utils shadow silo sparcutils sysklogd sysvinit tar tcsh \
               txtutils umsprogs util vmlinux zoneinfo
do
#   rpkg="`find_package $PACKAGE`"
#   if fgrep \"$PACKAGE\" $TMP/SeTpkgs 1> /dev/null 2> /dev/null
#   then
#      echo "$rpkg: ADD" >> $TMP/SeTnewtag
#   else
#      echo "$rpkg: SKP" >> $TMP/SeTnewtag
#   fi
#done
 if fgrep \"$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
