#!/bin/bash
if [ $UID -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
if [ ! -e /etc/libretools.conf ]; then
echo "Config file doesn't exists"
exit 1
fi
source /etc/libretools.conf
echo "Updating the main chroot"
mkarchroot -u -c ${CACHEDIR} ${CHROOTDIR}/${CHROOT}
echo "Creating the package"
makechrootpkg -c -r ${CHROOTDIR} -l ${CHCOPY} -- $@
exit 0