summaryrefslogtreecommitdiffstats
path: root/scripts/libmakepkg/util
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2018-05-02 20:24:44 +0200
committerAllan McRae <allan@archlinux.org>2018-05-12 13:11:52 +0200
commit542c3cf812e32989610cb09f40dbc237f2fba9bb (patch)
tree16e7eb0b36d8d61dc93a3fe6cd0aaa5e888e0940 /scripts/libmakepkg/util
parent2c94118dc168f16231e38a84c0b569b5b0006fd9 (diff)
downloadpacman-542c3cf812e32989610cb09f40dbc237f2fba9bb.tar.gz
pacman-542c3cf812e32989610cb09f40dbc237f2fba9bb.tar.xz
libmakepkg: only save the shellopts we need
micro-optimization: We only care about temporarily enforcing extglob, so that is the only one we need to explicitly restore. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/libmakepkg/util')
-rw-r--r--scripts/libmakepkg/util/pkgbuild.sh.in4
-rw-r--r--scripts/libmakepkg/util/util.sh.in4
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in b/scripts/libmakepkg/util/pkgbuild.sh.in
index 2db46f1f..632f314d 100644
--- a/scripts/libmakepkg/util/pkgbuild.sh.in
+++ b/scripts/libmakepkg/util/pkgbuild.sh.in
@@ -80,8 +80,8 @@ extract_function_variable() {
printf -v attr_regex '^[[:space:]]* %s\+?=[^(]' "$2"
fi
- # save our shell options and turn on extglob
- local shellopts=$(shopt -p)
+ # this function requires extglob - save current status to restore later
+ local shellopts=$(shopt -p extglob)
shopt -s extglob
while read -r; do
diff --git a/scripts/libmakepkg/util/util.sh.in b/scripts/libmakepkg/util/util.sh.in
index f9af5f32..726d2005 100644
--- a/scripts/libmakepkg/util/util.sh.in
+++ b/scripts/libmakepkg/util/util.sh.in
@@ -42,8 +42,8 @@ is_array() {
local v=$1
local ret=1
- # this function requires extglob - save current options to restore later
- local shellopts=$(shopt -p)
+ # this function requires extglob - save current status to restore later
+ local shellopts=$(shopt -p extglob)
shopt -s extglob
if [[ $(declare -p "$v") == declare\ -*([[:alnum:]])a*([[:alnum:]])\ * ]]; then