#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from python_append(Python append packages)" \
  --checklist "select packages from python_append 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 \
"Twisted" "" "on" \
"dbus_python" "" "on" \
"dbus_python2" "" "on" \
"docutils" "" "on" \
"gdata" "" "on" \
"ipaddr_py" "Python IP address manipulation library" "on" \
"mutagen" "" "on" \
"notify_python" "" "on" \
"numpy" "" "on" \
"pil" "" "on" \
"progressbar" "Text progressbar library for python" "on" \
"pyPdf" "" "on" \
"py_notify" "" "on" \
"pycairo" "" "on" \
"pycups" "" "on" \
"pycups2" "" "on" \
"pycurl" "" "on" \
"pycurl2" "" "on" \
"pygobject3" "" "on" \
"pygtksourceview" "" "on" \
"pyorbit" "" "on" \
"pyparsing" "An alternative approach to creating and executing simple grammers" "on" \
"pypoppler" "" "on" \
"pyqt" "" "on" \
"python_ipy" "Class and tools for handling of IPv4 and IPv6 addresses and networks" "on" \
"python_setuptools" "" "on" \
"pyxdg" "" "on" \
"rdflib" "" "on" \
"sip" "" "on" \
"urlgrabber" "A high-level cross-protocol url-grabber" "on" \
"urwid" "" "on" \
"zope.interface" "" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in Twisted dbus_python dbus_python2 docutils gdata ipaddr_py mutagen notify_python numpy pil progressbar pyPdf py_notify pycairo pycups pycups2 pycurl pycurl2 pygobject3 pygtksourceview pyorbit pyparsing pypoppler pyqt python_ipy python_setuptools pyxdg rdflib sip urlgrabber urwid zope.interface  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in Twisted dbus_python dbus_python2 docutils gdata ipaddr_py mutagen notify_python numpy pil progressbar pyPdf py_notify pycairo pycups pycups2 pycurl pycurl2 pygobject3 pygtksourceview pyorbit pyparsing pypoppler pyqt python_ipy python_setuptools pyxdg rdflib sip urlgrabber urwid zope.interface  ; 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
