. lib/lsb/init-functions
VERSION=$(grep version var/lib/pkg/nutyx-version |cut -d " " -f2)
[ ! -d etc/ports ] && mkdir -p etc/ports
for i in base cli gui \
cli-extra gui-extra \
xfce4 xfce4-extra \
mate mate-extra \
kde5 kde5-extra \
lxqt lxqt-extra \
lxde lxde-extra \
nos

do
   if [ ! -f etc/ports/$i.cards ]; then
      echo "host=downloads.nutyx.org
destination=/usr/ports/$i
version=$VERSION
collection=$i" > etc/ports/$i.cards
      log_success_msg "${WARNING} /etc/ports/$i.cards created ${NORMAL}"
      log_warning_msg "${WARNING} Double check /etc/ports/$i and adapted to your needs ${NORMAL}"
   else
      log_warning_msg "${WARNING} Double check /etc/ports/$i and adapted to this version of NuTyX ${NORMAL}"
   fi
done
if [ ! -f etc/pkgmk.conf ]; then
   if [ -f etc/pkgmk.conf.example ]; then
	cp etc/pkgmk.conf.example etc/pkgmk.conf
	log_success_msg "${WARNING} /etc/pkgmk.conf.example copied as /etc/pkgmk.conf ${NORMAL}"
	log_warning_msg "${WARNING} Double check /etc/pkgmk.conf and adapted to your needs ${NORMAL}"
   fi
fi
