Fix CLEANUP/KEEPLOG not working when set to NO.

Before this patch, they were conditionally unset before
the code checking for the presence of all the required
configuration variables.
While at it, clean up the code a little.

Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-07-13 15:38:52 +00:00
parent dff0d70720
commit 4f9e3b24e6

View file

@ -111,20 +111,11 @@ config_check() {
echo "$SCRIPT: No $SBOPKG_CONF or ~/.sbopkg.conf was found." 1>&2
echo "Please create at least one of them and run $SCRIPT again." 1>&2
exit 1
else
fi
[[ -e $SBOPKG_CONF ]] && . $SBOPKG_CONF
[[ -e $HOME/.sbopkg.conf ]] && . $HOME/.sbopkg.conf
if [[ $KEEPLOG == [Yy][Ee][Ss] ]]; then
KEEPLOG=1
else
unset KEEPLOG
fi
if [[ $CLEANUP == [Yy][Ee][Ss] ]]; then
CLEANUP=1
else
unset CLEANUP
fi
# Some configuration options are mandatory
for VAR in REPO_ROOT LOGDIR QUEUEDIR SRCDIR SBOPKGTMP REPO_NAME \
REPO_BRANCH KEEPLOG CLEANUP LOGFILE DEBUG TMP OUTPUT RSYNCFLAGS \
@ -155,6 +146,13 @@ EOF
echo "The \$DEBUG variable must be set to 0, 1, or 2." 1>&2
exit 1
fi
# Convert some YES/NO variables into 'set/unset' ones.
if [[ $KEEPLOG == [Nn][Oo] ]]; then
unset KEEPLOG
fi
if [[ $CLEANUP == [Nn][Oo] ]]; then
unset CLEANUP
fi
# Make sure there are no unexpected files in $SBOPKGTMP