#!/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 X (X Window System)" \
--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." 22 70 11 \
"dejavu-ttf" "DejaVu TrueType font family" "on" \
"fontconfig" "Font configuration library" "on" \
"ttf-indic-fonts" "Indic script TrueType fonts" "on" \
"x11" "Main X package" "on" \
"x11-devel" "Libraries and headers for X programming" "on" \
"x11-docs" "Documentation for X" "on" \
"x11-docs-html" "HTML documentation for X" "on" \
"x11-fonts-100dpi" "100dpi screen fonts" "on" \
"x11-fonts-cyrillic" "Cyrillic fonts" "on" \
"x11-fonts-misc" "Basic fonts needed to run X" "on" \
"x11-fonts-scale" "Scalable Type1 and TrueType fonts" "on" \
"x11-xdmx" "Distributed Multi-head X server" "on" \
"x11-xnest" "Experimental nested X server" "on" \
"x11-xvfb" "Virtual framebuffer X server" "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
  rm -f $TMP/SeTpkgs
#  rm -f $TMP/SeTnewtag
  cat /dev/null > $TMP/SeTnewtag
  for PKG in dejavu-ttf fontconfig ttf-indic-fonts x11 x11-devel x11-docs x11-docs-html x11-fonts-100dpi x11-fonts-cyrillic x11-fonts-misc x11-fonts-scale x11-xdmx x11-xnest x11-xvfb ; do
    echo "$PKG: SKP" >> $TMP/SeTnewtag
  done
  exit
fi
cat /dev/null > $TMP/SeTnewtag
for PKG in dejavu-ttf fontconfig ttf-indic-fonts x11 x11-devel x11-docs x11-docs-html x11-fonts-100dpi x11-fonts-cyrillic x11-fonts-misc x11-fonts-scale x11-xdmx x11-xnest x11-xvfb ; do
  if grep \"$PKG\" $TMP/SeTpkgs 1> /dev/null 2> /dev/null ; then
    echo "$PKG: ADD" >> $TMP/SeTnewtag
  else
    echo "$PKG: SKP" >> $TMP/SeTnewtag
  fi
done
rm -f $TMP/SeTpkgs
