mirror of
https://github.com/sbopkg/sbopkg
synced 2024-12-27 09:58:28 +01:00
changed the way missing variables are handled; thanks to slakmagik for the suggestions
This commit is contained in:
parent
96e4fbd924
commit
38e42516d8
1 changed files with 12 additions and 9 deletions
|
@ -43,17 +43,20 @@ if [ ! -e $SBOPKG_CONF ]; then
|
||||||
echo "Please create it and run $SCRIPT again." 1>&2
|
echo "Please create it and run $SCRIPT again." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
for i in RSYNCMIRROR SLACKVER LOCALREPO SRCDIR TMP KEEPLOG
|
. $SBOPKG_CONF
|
||||||
do
|
for VAR in RSYNCMIRROR SLACKVER LOCALREPO SRCDIR TMP KEEPLOG; do
|
||||||
grep "^$i=.\{1,\}" "$SBOPKG_CONF" > /dev/null
|
if [ -z "${!VAR}" ]; then
|
||||||
if [ "$?" != 0 ]; then
|
MISSING+="$VAR "
|
||||||
echo "$SCRIPT: Can't find variable $i declared in"
|
fi
|
||||||
echo "$SCRIPT: $SBOPKG_CONF."
|
done
|
||||||
echo "Please declare it and run $SCRIPT again."
|
if [ "$MISSING" ]; then
|
||||||
|
echo "$SCRIPT: Can't find a value for variable(s):"
|
||||||
|
echo "$MISSING"
|
||||||
|
echo "Please correct this error and run $SCRIPT again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
. $SBOPKG_CONF
|
#. $SBOPKG_CONF
|
||||||
done
|
#done
|
||||||
fi
|
fi
|
||||||
if [ ! -d "$SRCDIR" ]; then
|
if [ ! -d "$SRCDIR" ]; then
|
||||||
echo "Creating local cache directory $SRCDIR to keep \
|
echo "Creating local cache directory $SRCDIR to keep \
|
||||||
|
|
Loading…
Reference in a new issue