makepkg: abort when failing to create BUILDDIR

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2012-03-09 17:27:43 +10:00 committed by Dan McGee
parent 44de3183ff
commit 573bd80f14
1 changed files with 5 additions and 2 deletions

View File

@ -2052,8 +2052,11 @@ readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
BUILDDIR=${_BUILDDIR:-$BUILDDIR}
BUILDDIR=${BUILDDIR:-$startdir} #default to $startdir if undefined
if [[ ! -d $BUILDDIR ]]; then
mkdir -p "$BUILDDIR" ||
error "$(gettext "You do not have write permission to create packages in %s.")" "$BUILDDIR"
if ! mkdir -p "$BUILDDIR"; then
error "$(gettext "You do not have write permission to create packages in %s.")" "$BUILDDIR"
plain "$(gettext "Aborting...")"
exit 1
fi
chmod a-s "$BUILDDIR"
fi
if [[ ! -w $BUILDDIR ]]; then