#!/bin/bash
# Under the terms of the 'COPYRIGHT.TXT' file.

# Conformamos el men:
cat << EOF > ${TMP}/show_series
dialog \\
 --clear \\
 --backtitle "Choosing the series" \\
 --title "SELECT THE SERIES OF THE PACKAGES" \\
 --item-help \\
 --checklist \\
"The following series were found in the \\
installation.\n\nSelect the series that you want to install:" 0 0 9 \\
EOF

# Lo haremos segn las series encontradas:
if [[ -d ${SRC_INS}/base ]]; then
  echo "\"base\" \"\" on \"Base system GNU Linux.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/devel ]]; then
  echo "\"devel\" \"\" on \"Compilers, debuggers and programming languages.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/java ]]; then
  echo "\"java\" \"\" on \"Java support based on the OpenJDK Project.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/kernel ]]; then
  echo "\"kernel\" \"\" on \"Kernel from Linux-Libre: images, headers, and modules.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/libraries ]]; then
  echo "\"libraries\" \"\" on \"System libraries.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/media ]]; then
  echo "\"media\" \"\" on \"Multimedia applications and libraries.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/modules ]]; then
  echo "\"modules\" \"\" on \"Modules of various programming languages.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/networking ]]; then
  echo "\"networking\" \"\" on \"Clients and servers for networking.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/printing ]]; then
  echo "\"printing\" \"\" on \"Printing support.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/scanner ]]; then
  echo "\"scanner\" \"\" on \"Scanner support.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/tools ]]; then
  echo "\"tools\" \"\" on \"Contains the tools and complements of the base system.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/x-applications ]]; then
  echo "\"x-applications\" \"\" on \"A collection of applications for the environment X.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/x-libraries ]]; then
  echo "\"x-libraries\" \"\" on \"A collection of libraries for the environment X.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/x-xfce ]]; then
  echo "\"x-xfce\" \"\" on \"Xfce is a graphical environment: light, simple, and lightweight.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/x-xfce-goodies ]]; then
  echo "\"x-xfce-goodies\" \"\" on \"Additional applications for Xfce.\" \\" \
   >> ${TMP}/show_series
fi
if [[ -d ${SRC_INS}/x-xorg ]]; then
  echo "\"x-xorg\" \"\" on \"The X Window System (Xorg) used in GNU Linux.\" \\" \
   >> ${TMP}/show_series
fi

echo " 2> ${TMP}/return-series" >> ${TMP}/show_series

. ${TMP}/show_series; CODE=$?
(( $CODE != 0 )) && exit $CODE;

( cd $TMP
  rm -f series.in
  for i in $(cat return-series | tr -d \"); do
    echo "$i" >> series.in
  done
)

