ERR trap was being toggled on and off in 3 places in confusingly different
ways. One of these ocurrances went untouched after this commit. Since disabling
the ERR trap is unintuitive enough, at least it should be done in a way that is
uniform across makepkg.

Also, in check_deps the ERR trap was being disabled before needed. If
the assignments included in the range were unsuccesful because the variables
had the readonly attribute, makepkg would've exited without "unknown error"
thanks to errexit.

Signed-off-by: Andres P <[email protected]>
---
 scripts/makepkg.sh.in |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2237cfe..bbc28d9 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -389,11 +389,9 @@ check_deps() {
 
        # Disable error trap in pacman subshell call as this breaks bash-3.2 
compatibility
        # Also, a non-zero return value is not unexpected and we are manually 
dealing them
-       set +E
        local ret=0
        local pmout
-       pmout=$(run_pacman -T "$@") || ret=$?
-       set -E 
+       pmout=$(set +E; run_pacman -T "$@") || ret=$?
        
        if (( ret == 127 )); then #unresolved deps
                echo "$pmout"
@@ -427,10 +425,9 @@ handle_deps() {
 
        # we might need the new system environment
        # avoid triggering the ERR trap
-       local restoretrap=$(trap -p ERR)
-       trap - ERR
+       set +E
        source /etc/profile &>/dev/null
-       eval $restoretrap
+       set -E
 
        return $R_DEPS_SATISFIED
 }
-- 
1.7.1


Reply via email to