index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2014-12-22 09:04:53 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2016-12-05 15:20:08 +1000 |
commit | 9ce2c9b1872b44cebe1ce54c2a7398fbbc31fc6a (patch) | |
tree | 3bc2f505d7b29e0e24d05ac377bba0f0d6a5de31 | |
parent | cef0d726b454fcd93fc3d42ee7372c1f290db758 (diff) |
-rw-r--r-- | scripts/makepkg.sh.in | 19 |
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index a1385c17..a97cdc28 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -398,20 +398,23 @@ prepare_buildenv() { } run_function_safe() { - local restoretrap + local restoretrap restoreset restoreshopt - set -e - set -E + # we don't set any special shopts of our own, but we don't want the user to + # muck with our environment. + restoreshopt=$(shopt -p) + + restoreset=$(shopt -o -p) + shopt -o -s errexit errtrace restoretrap=$(trap -p ERR) - trap 'error_function $pkgfunc' ERR + trap "error_function '$1'" ERR run_function "$1" - eval $restoretrap - - set +E - set +e + eval "$restoretrap" + eval "$restoreset" + eval "$restoreshopt" } run_function() { |