index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz@archlinux.org> | 2018-05-30 22:50:23 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2018-06-18 13:15:51 +1000 |
commit | c37a06fe1d1fbd2be73adc725323e8a4665eeb09 (patch) | |
tree | fb61a7672abd61e84a8213072c1fd25205d29b34 /scripts/libmakepkg/util/util.sh.in | |
parent | 9eb3695a3ff850b9dff66d667a4b27be1a233f42 (diff) |
-rw-r--r-- | scripts/libmakepkg/util/util.sh.in | 10 |
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 } |