#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "Select pkgs from kernelsrc(Linux kernel source codes)"   --checklist "Select packages to install from kernelsrc series. Use cursor up/down to select the package, mark(*) by space key. Push Enter to start install." 24 72 15 "kernelsrc" "kernel source code" "on" \
"mkinitramfs" "tool for initramfs" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in kernelsrc mkinitramfs  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in kernelsrc mkinitramfs ; 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

