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>
This commit is contained in:
parent
b373b1d16b
commit
59776ef306
1 changed files with 4 additions and 0 deletions
|
@ -675,6 +675,8 @@ run_build() {
|
||||||
|
|
||||||
# ensure all necessary build variables are exported
|
# ensure all necessary build variables are exported
|
||||||
export CFLAGS CXXFLAGS MAKEFLAGS CHOST
|
export CFLAGS CXXFLAGS MAKEFLAGS CHOST
|
||||||
|
# save our shell options so build() can't override what we need
|
||||||
|
local shellopts=$(shopt -p)
|
||||||
|
|
||||||
local ret=0
|
local ret=0
|
||||||
if [ "$LOGGING" = "1" ]; then
|
if [ "$LOGGING" = "1" ]; then
|
||||||
|
@ -695,6 +697,8 @@ run_build() {
|
||||||
else
|
else
|
||||||
build 2>&1 || ret=$?
|
build 2>&1 || ret=$?
|
||||||
fi
|
fi
|
||||||
|
# reset our shell options
|
||||||
|
eval "$shellopts"
|
||||||
|
|
||||||
if [ $ret -gt 0 ]; then
|
if [ $ret -gt 0 ]; then
|
||||||
error "$(gettext "Build Failed.")"
|
error "$(gettext "Build Failed.")"
|
||||||
|
|
Loading…
Add table
Reference in a new issue