Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorAndres P <aepd87@gmail.com>2010-06-25 18:46:37 -0430
committerDan McGee <dan@archlinux.org>2010-12-12 20:24:59 -0600
commit579533d1a07808c3e0458d6042d6039e56c38de2 (patch)
tree08d39f3ca313c1ec50e308fc1100033df7ca7717 /scripts/makepkg.sh.in
parent330951200c8a0bb90937e0578510a41220154726 (diff)
makepkg: do not ignore errors from pacman when checking deps
As check_deps is run in a subshell, exit had the same meaning as return. Since the intention is to halt makepkg when pacman throws an error other than 127, the enclosing function has to handle error control instead. Fixes FS#19840 Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 0b2b48aa..f5402222 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -397,7 +397,7 @@ check_deps() {
echo "$pmout"
elif (( ret )); then
error "$(gettext "'%s' returned a fatal error (%i): %s")" "$PACMAN" "$ret" "$pmout"
- exit 1
+ return "$ret"
fi
}
@@ -437,14 +437,15 @@ resolve_deps() {
local R_DEPS_SATISFIED=0
local R_DEPS_MISSING=1
- local deplist="$(check_deps $*)"
- if [[ -z $deplist ]]; then
- return $R_DEPS_SATISFIED
- fi
+ # deplist cannot be declared like this: local deplist=$(foo)
+ # Otherwise, the return value will depend on the assignment.
+ local deplist
+ deplist="$(set +E; check_deps $*)" || exit 1
+ [[ -z $deplist ]] && return $R_DEPS_SATISFIED
if handle_deps $deplist; then
# check deps again to make sure they were resolved
- deplist="$(check_deps $*)"
+ deplist="$(set +E; check_deps $*)" || exit 1
[[ -z $deplist ]] && return $R_DEPS_SATISFIED
elif (( DEP_BIN )); then
error "$(gettext "Failed to install all missing dependencies.")"