From 9615930eb42a76914e9a739aa2e54a43e7041779 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 6 May 2010 22:01:36 +0200 Subject: [PATCH] init_funcs.sh::set_defvars() bailout if required dirs cannot be found. --- xbps-src/shutils/init_funcs.sh.in | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/xbps-src/shutils/init_funcs.sh.in b/xbps-src/shutils/init_funcs.sh.in index 9f8d57eca33..979b8acc344 100644 --- a/xbps-src/shutils/init_funcs.sh.in +++ b/xbps-src/shutils/init_funcs.sh.in @@ -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"