#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from Haskell(Haskell related packages)" \
  --checklist "select packages from Haskell 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 \
"Cabal" "A framework for packaging Haskell software" "on" \
"aeson" "Fast JSON parsing and encoding library" "on" \
"base64_bytestring" "Fast base64 encoding and decoding for ByteStrings" "on" \
"base_unicode_symbols" "Unicode alternatives for common functions and operators" "on" \
"blaze_builder" "Efficient buffered output library" "on" \
"blaze_html" "A blazingly fast HTML combinator library for Haskell" "on" \
"blaze_markup" "A blazingly fast markup combinator library for Haskell" "on" \
"cabal_install" "The command-line interface for Cabal and Hackage" "on" \
"conduit" "Streaming data processing library" "on" \
"data_default" "A class for types with a default value" "on" \
"data_default_class" "A class for types with a default value" "on" \
"data_default_instances_base" "Default instances for types in base" "on" \
"data_default_instances_containers" "Default instances for types in containers" "on" \
"data_default_instances_dlist" "Default instances for types in dlist" "on" \
"data_default_instances_old_locale" "Default instances for types in old-locale" "on" \
"digest" "Various cryptographic hashes for bytestrings" "on" \
"dlist" "Haskell library for differences lists" "on" \
"extensible_exceptions" "Extensible exceptions library" "on" \
"ghc" "The Glasgow Haskell Compilation system" "on" \
"haskell_platform" "Standard Haskell libraries and tools" "on" \
"haskell_yaml" "Support for parsing and rendering YAML documents" "on" \
"highlighting_kate" "Syntax highlighting library" "on" \
"hscolour" "Haskell program to colourise Haskell code" "on" \
"hslua" "A Lua language interpreter embedding in Haskell" "on" \
"lifted_base" "lifted IO operations from the base library" "on" \
"mmorph" "Monad morphisms" "on" \
"monad_control" "Lift control operations through monad transformers" "on" \
"nats" "Types for natulal (and whole) numbers" "on" \
"pandoc" "Conversion between markup format" "on" \
"pandoc_types" "Types for representing a structured document" "on" \
"regex_pcre_builtin" "Replaces/Enhances Text.Regex" "on" \
"resourcet" "Deterministic allocation and freeing of scarce resources" "on" \
"semigroups" "Anything that associates" "on" \
"tagsoup" "Parsing and extracting information from (possibly malformed) HTML/XML documents" "on" \
"temporary" "Portable temporary file and directory support for Windows and Unix" "on" \
"texmath" "Conversion of LaTeX math formulas to MathML or OMML" "on" \
"transformers_base" "Lift computations from the bottom of a transformer stack" "on" \
"utf8_string" "Support for reading and writing UTF8 Strings" "on" \
"void" "A Haskell 98 logically uninhabited data type" "on" \
"xml" "A simple XML library" "on" \
"zip_archive" "Library for creating and modifying zip archives" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in Cabal aeson base64_bytestring base_unicode_symbols blaze_builder blaze_html blaze_markup cabal_install conduit data_default data_default_class data_default_instances_base data_default_instances_containers data_default_instances_dlist data_default_instances_old_locale digest dlist extensible_exceptions ghc haskell_platform haskell_yaml highlighting_kate hscolour hslua lifted_base mmorph monad_control nats pandoc pandoc_types regex_pcre_builtin resourcet semigroups tagsoup temporary texmath transformers_base utf8_string void xml zip_archive  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in Cabal aeson base64_bytestring base_unicode_symbols blaze_builder blaze_html blaze_markup cabal_install conduit data_default data_default_class data_default_instances_base data_default_instances_containers data_default_instances_dlist data_default_instances_old_locale digest dlist extensible_exceptions ghc haskell_platform haskell_yaml highlighting_kate hscolour hslua lifted_base mmorph monad_control nats pandoc pandoc_types regex_pcre_builtin resourcet semigroups tagsoup temporary texmath transformers_base utf8_string void xml zip_archive  ; 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
