#!/bin/sh
#item   ####description                                      ###on off ###
rm -f /tmp/SeTnewtag # empty the return file
dialog --title "SELECTING PACKAGES FOR SERIES K (Linux kernel source)" \
       --checklist "Please select the packages you wish to install \
from series K. 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." 18 70 7 \
"lx1213_1" "Linux kernel source 1.2.13, part 1" "on" \
"lx1213_2" "Linux kernel source 1.2.13, part 2 (include files)" "on" \
"lx1213_3" "Linux kernel source 1.2.13, part 3" "on" \
"lx1320_1" "Linux kernel source 1.3.20, part 1" "off" \
"lx1320_2" "Linux kernel source 1.3.20, part 2" "off" \
"lx1320_3" "Linux kernel source 1.3.20, part 3" "off" \
"lx1320_4" "Linux kernel source 1.3.20, part 4" "off" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f /tmp/SeTpkgs
 exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in \
lx1213_1 lx1213_2 lx1213_3 \
lx1320_1 lx1320_2 lx1320_3 lx1320_4 ; 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
