#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from TTfont(TTfont related packages)" \
  --checklist "select packages from TTfont 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 \
"IPAexfont" "" "on" \
"IPAfont" "" "on" \
"VLGothic" "" "on" \
"fontconfig" "" "on" \
"fonts_migmix" "" "on" \
"fonts_migu" "" "on" \
"freefont_ttf" "" "on" \
"freetype" "" "on" \
"ttf_bitstream_vera" "" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in IPAexfont IPAfont VLGothic fontconfig fonts_migmix fonts_migu freefont_ttf freetype ttf_bitstream_vera  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in IPAexfont IPAfont VLGothic fontconfig fonts_migmix fonts_migu freefont_ttf freetype ttf_bitstream_vera  ; 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
