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

View file

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