xbps-src: if euid can't write to masterdir, exit gracefully.

This commit is contained in:
Juan RP 2011-10-30 09:27:46 +01:00
parent 5dc6d62e3e
commit cc85809e29
1 changed files with 3 additions and 5 deletions

View File

@ -215,11 +215,9 @@ check_config_vars()
msg_error "'${f}' not set in configuration file!\n" msg_error "'${f}' not set in configuration file!\n"
fi fi
done done
if [ ! -d "$XBPS_MASTERDIR" ]; then if [ ! -w "$XBPS_MASTERDIR" ]; then
mkdir -p "$val" echo "ERROR: not enough perms for masterdir $XBPS_MASTERDIR.\n"
if [ $? -ne 0 ]; then exit 1
msg_error "couldn't create 'XBPS_MASTERDIR' directory\n"
fi
fi fi
[ -z "${_MASTERDIR_FLAG}" ] && export _MASTERDIR="$XBPS_MASTERDIR" [ -z "${_MASTERDIR_FLAG}" ] && export _MASTERDIR="$XBPS_MASTERDIR"
} }