#!/bin/sh
#item   ####description                                      ###on off ###
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
  mkdir -p $TMP
fi
cat /dev/null > $TMP/SeTnewtag
dialog --backtitle "Slackware installer: package selection" --title "SELECTING PACKAGES FROM SERIES Y (GAMES)" \
--checklist "Please select the packages you wish to install from this series. \
Use the UP/DOWN keys to scroll through the \
list, and the SPACE key to select the packages you wish to \
install. Recommended packages have already been selected for \
you, but you may unselect them if you wish. \
 \
Press ENTER when you are done." \
11 70 1 \
"bsd-games" "The BSD text games collection" "on" \
"nethack" "Rogue-like game" "on" \
2> $TMP/SeTpkgs
# If the user pressed cancel, or something bad happened then we
# mark all packages as skipped and bail out.
if [ $? = 1 -o $? = 255 ]; then
   # Not in Slackware, but a nice addition for Slackware ARM whilst
   # we're processing the package selection:
   dialog \
      --backtitle "Slackware installer: package selection" \
      --infobox "Marking all packages as skipped" 3 35
    rm -f $TMP/SeTpkgs
    # Empty, but not delete this file:
    > $TMP/SeTnewtag
  for PKG in \
bsd-games nethack  \ ; do
    echo "$PKG: SKP" >> $TMP/SeTnewtag
  done
  exit
fi
dialog \
  --backtitle "Slackware installer: package selection" \
  --infobox "Processing package selection" 3 33
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in \
bsd-games nethack  \ ; do
 if grep "\(^\| \)$PACKAGE\( \|$\)" $TMP/SeTpkgs > /dev/null 2>&1 ; then
    echo "$PACKAGE: ADD" >> $TMP/SeTnewtag
  else
    echo "$PACKAGE: SKP" >> $TMP/SeTnewtag
  fi
done
rm -f $TMP/SeTpkgs
