From 59776ef306935399b2bf1e9cbdd7a7bfa6df1b49 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 4 Dec 2008 20:44:27 -0600 Subject: 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 --- scripts/makepkg.sh.in | 4 ++++ 1 file changed, 4 insertions(+) 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.")" -- cgit v1.2.3-24-g4f1b