#!/bin/sh
#item   ####description                                      ###on off ###
cat /dev/null > /tmp/SeTnewtag
dialog --title "SELECTING PACKAGES FROM SERIES AP (APPLICATIONS)" \
       --checklist "Please select the packages you wish to install \
from series AP. 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." 22 70 11 \
"ispell" "The International version of ispell" "off" \
"jove" "Jonathan's Own Version of Emacs text editor" "off" \
"manpgs" "More man pages (online documentation)" "on" \
"diff" "GNU diffutils" "on" \
"sudo" "Allow special users limited root access" "off" \
"ghostscr" "GNU Ghostscript version 3.33" "off" \
"gsfonts1" "Ghostscript fonts (part one)" "off" \
"gsfonts2" "Ghostscript fonts (part two)" "off" \
"gsfonts3" "Ghostscript fonts (part three)" "off" \
"jed" "JED programmer's editor" "on" \
"joe" "joe text editor, version 2.8" "on" \
"jpeg" "JPEG image compression utilities" "off" \
"bc" "GNU bc - arbitrary precision math language" "off" \
"workbone" "a text-based audio CD player" "off" \
"mc" "The Midnight Commander file manager" "off" \
"mt_st" "mt ported from BSD - controls tape drive" "off" \
"groff" "GNU troff document formatting system" "on" \
"quota" "User disk quota utilities" "on" \
"sc" "The 'sc' spreadsheet" "off" \
"texinfo" "GNU texinfo documentation system" "on" \
"vim" "Improved vi clone" "off" \
"ash" "A small /bin/sh type shell - 62K" "off" \
"zsh" "Zsh - a custom *nix shell" "off" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f /tmp/SeTpkgs
 > /tmp/SeTnewtag
 for pkg in ash bc diff ghostscr gsfonts1 joe mt_st quota sudo groff ispell \
  jpeg workbone gsfonts2 gsfonts3 jove jed manpgs mc sc texinfo vim zsh ; do
  echo "$pkg: SKP" >> /tmp/SeTnewtag
 done
 exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in ispell jove manpgs bc \
groff sc workbone ghostscr gsfonts1 joe gsfonts2 gsfonts3 \
mc jpeg ash jed mt_st texinfo vim sudo diff zsh \
quota ; do
 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