summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2018-08-14 03:20:56 +0200
committerAllan McRae <allan@archlinux.org>2018-10-21 12:03:41 +0200
commite12d03217430500be269392463876440210f7916 (patch)
treeedce4102d7581b9cc15c85bc6713def79a02e29a
parentea877c596bc380acd608468e4e38186ac0252197 (diff)
downloadpacman-e12d03217430500be269392463876440210f7916.tar.gz
pacman-e12d03217430500be269392463876440210f7916.tar.xz
makepkg: use bash 4.4 to localize `set` without explicitly saving/restoring
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--scripts/makepkg.sh.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2d587883..25a8fc26 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -422,13 +422,14 @@ prepare_buildenv() {
}
run_function_safe() {
- local restoretrap restoreset restoreshopt
+ local restoretrap restoreshopt
# 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)
+ # localize 'set' shell options to this function - this does not work for shopt
+ local -
shopt -o -s errexit errtrace
restoretrap=$(trap -p ERR)
@@ -438,7 +439,6 @@ run_function_safe() {
trap - ERR
eval "$restoretrap"
- eval "$restoreset"
eval "$restoreshopt"
}