aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2015-11-09 18:39:47 +0100
committerMichał Górny <mgorny@gentoo.org>2015-11-12 20:32:37 +0100
commitc7b5c849905a00774bd4957e14b49cfe0e6ceafd (patch)
tree8cb9e3196cd5e4db989bb72afab31019a7e15134
parenteapply_user: Make idempotent per changes to EAPI 6 (diff)
downloadportage-c7b5c849905a00774bd4957e14b49cfe0e6ceafd.tar.gz
portage-c7b5c849905a00774bd4957e14b49cfe0e6ceafd.tar.bz2
portage-c7b5c849905a00774bd4957e14b49cfe0e6ceafd.zip
eapply: Pass exit status through on non-fatal failures
-rw-r--r--bin/phase-helpers.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 511a41a4d..7e5dbbc22 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -981,6 +981,8 @@ fi
if ___eapi_has_eapply; then
eapply() {
+ local failed
+
_eapply_patch() {
local f=${1}
local prefix=${2}
@@ -994,9 +996,9 @@ if ___eapi_has_eapply; then
# --no-backup-if-mismatch not to pollute the sources
patch -p1 -f -s -g0 --no-backup-if-mismatch \
"${patch_options[@]}" < "${f}"
- if ! eend ${?}; then
+ failed=${?}
+ if ! eend "${failed}"; then
__helpers_die "patch -p1 ${patch_options[*]} failed with ${f}"
- failed=1
fi
}
@@ -1054,13 +1056,13 @@ if ___eapi_has_eapply; then
_eapply_patch "${f2}" ' '
# in case of nonfatal
- [[ -n ${failed} ]] && return 1
+ [[ ${failed} -ne 0 ]] && return "${failed}"
done
else
_eapply_patch "${f}"
# in case of nonfatal
- [[ -n ${failed} ]] && return 1
+ [[ ${failed} -ne 0 ]] && return "${failed}"
fi
done