Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/libmakepkg/util
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/libmakepkg/util')
-rw-r--r--scripts/libmakepkg/util/util.sh.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/libmakepkg/util/util.sh.in b/scripts/libmakepkg/util/util.sh.in
index c2f9c624..e1ca5cb7 100644
--- a/scripts/libmakepkg/util/util.sh.in
+++ b/scripts/libmakepkg/util/util.sh.in
@@ -86,12 +86,12 @@ ensure_writable_dir() {
local dirtype="$1" dirpath="$2"
if ! mkdir -p "$dirpath" 2>/dev/null; then
- if [[ -d $dirpath && ! -w $dirpath ]]; then
- error "$(gettext "You do not have write permission for the directory \$%s (%s).")" "$dirtype" "$dirpath"
- else
- error "$(gettext "Failed to create the directory \$%s (%s).")" "$dirtype" "$dirpath"
- fi
+ error "$(gettext "Failed to create the directory \$%s (%s).")" "$dirtype" "$dirpath"
+ return 1
+ elif [[ ! -w $dirpath ]]; then
+ error "$(gettext "You do not have write permission for the directory \$%s (%s).")" "$dirtype" "$dirpath"
return 1
fi
+
return 0
}