#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "Qt4(Qt4 UI framework)シリーズの選択" \
  --checklist "Qt4 シリーズの中からインストールしたいパッケージを \
選んでください．カーソルの上下キーで \
対象を選択し，space キーでマーク(X)します． \
Enter キーでインストールを開始します．" 24 72 15 \
"QScintilla_gpl" "Qt版Scintilla" "on" \
"QtZeitgeist" "Qt版Zeitgeist" "on" \
"libdbusmenu_qt" "Dbus-menu用Qtライブラリ" "on" \
"polkit_qt_1" "Policy-Kit Qt" "on" \
"qca" "Qt Cryptography Architecture" "on" \
"qt" "Qt UI フレームワーク" "on" \
"qt_gstreamer" "GStreamer用Qtライブラリ" "on" \
"qt_mobility" "モバイルデバイス操作用Qtライブラリ" "on" \
"qtscriptgenerator" "QTscriptジェネレーター" "on" \
"qwt" "グラフ作画用Qtモジュール" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in QScintilla_gpl QtZeitgeist libdbusmenu_qt polkit_qt_1 qca qt qt_gstreamer qt_mobility qtscriptgenerator qwt  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in QScintilla_gpl QtZeitgeist libdbusmenu_qt polkit_qt_1 qca qt qt_gstreamer qt_mobility qtscriptgenerator qwt  ; 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
