Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-12-04 20:44:27 -0600
committerDan McGee <dan@archlinux.org>2008-12-07 22:09:24 -0600
commit59776ef306935399b2bf1e9cbdd7a7bfa6df1b49 (patch)
tree5e5528fccafdce236a5686a388d150c84c4ba73e /scripts/makepkg.sh.in
parentb373b1d16b6235bef2e34a9a21e043418222a813 (diff)
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>
Diffstat (limited to 'scripts/makepkg.sh.in')
-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.")"