init_funcs.sh::set_defvars() bailout if required dirs cannot be found.

This commit is contained in:
Juan RP 2010-05-06 22:01:36 +02:00
parent 71aa49c397
commit 9615930eb4
1 changed files with 10 additions and 7 deletions

View File

@ -42,18 +42,21 @@ set_defvars()
: ${XBPS_BUILDDIR:=$XBPS_MASTERDIR/pkg-builddir}
: ${XBPS_SRCDISTDIR:=$XBPS_MASTERDIR/pkg-srcdistdir}
DDIRS="TRIGGERSDIR HELPERSDIR SRCPKGDIR COMMONVARSDIR SHUTILSDIR"
DDIRS="$DDIRS DISTRIBUTIONDIR"
for i in ${DDIRS}; do
eval val="\$XBPS_$i"
if [ ! -d "$val" ]; then
echo "ERROR: cannot find $i at $val aborting."
exit 1
fi
done
for i in DESTDIR PACKAGESDIR BUILDDIR SRCDISTDIR; do
eval val="\$XBPS_$i"
[ ! -d "$val" ] && mkdir -p $val
done
DDIRS="XBPS_TRIGGERSDIR XBPS_HELPERSDIR"
DDIRS="$DDIRS XBPS_COMMONVARSDIR XBPS_SHUTILSDIR"
for i in ${DDIRS}; do
eval val="\$$i"
[ ! -d "$val" ] && msg_error "cannot find $i, aborting."
done
export XBPS_PKGDB_CMD="xbps-uhelper.static -r $XBPS_MASTERDIR"
export XBPS_BIN_CMD="xbps-bin.static -r $XBPS_MASTERDIR"
export XBPS_DIGEST_CMD="xbps-uhelper.static digest"