summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-12-05 03:44:27 +0100
committerDan McGee <dan@archlinux.org>2008-12-08 05:09:24 +0100
commit59776ef306935399b2bf1e9cbdd7a7bfa6df1b49 (patch)
tree5e5528fccafdce236a5686a388d150c84c4ba73e
parentb373b1d16b6235bef2e34a9a21e043418222a813 (diff)
downloadpacman-59776ef306935399b2bf1e9cbdd7a7bfa6df1b49.tar.gz
pacman-59776ef306935399b2bf1e9cbdd7a7bfa6df1b49.tar.xz
makepkg: save and restore shell options before and after build()
Fix the issue uncovered by FS#12344. In this instance, the dotglob shopt was being set in the build() function but never cleared, causing issues in the remaining parts of the makepkg script. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--scripts/makepkg.sh.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 4cc255cc..ef2ede1f 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -675,6 +675,8 @@ run_build() {
# ensure all necessary build variables are exported
export CFLAGS CXXFLAGS MAKEFLAGS CHOST
+ # save our shell options so build() can't override what we need
+ local shellopts=$(shopt -p)
local ret=0
if [ "$LOGGING" = "1" ]; then
@@ -695,6 +697,8 @@ run_build() {
else
build 2>&1 || ret=$?
fi
+ # reset our shell options
+ eval "$shellopts"
if [ $ret -gt 0 ]; then
error "$(gettext "Build Failed.")"