#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from SDL(Simple Direct media Layer)" \
  --checklist "select packages from SDL series. \
You can move cursor with UP/DOWN key and push space \
key to select pkgs. After finish selecting, \
push Enter to start installation. " 24 72 15 \
"SDL" "" "on" \
"SDL_image" "" "on" \
"SDL_mixer" "" "on" \
"SDL_ttf" "" "on" \
"smpeg" "" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in SDL SDL_image SDL_mixer SDL_ttf smpeg  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in SDL SDL_image SDL_mixer SDL_ttf smpeg  ; do
    if grep "$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
