[pacman-dev] [PATCH] libmakepkg: don't save/set/restore extglob in bash [[ tests

Eli Schwartz eschwartz at archlinux.org
Wed May 2 19:54:36 UTC 2018


Since bash 4.1 extglobs can be used within [[ ... ]] regardless of
whether the shopt is set. Our configure.ac requires bash 4.1.0 at a
minimum for pacman scripts.

Signed-off-by: Eli Schwartz <eschwartz at archlinux.org>
---
 scripts/libmakepkg/util/util.sh.in | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/scripts/libmakepkg/util/util.sh.in b/scripts/libmakepkg/util/util.sh.in
index f9af5f32..c2f9c624 100644
--- a/scripts/libmakepkg/util/util.sh.in
+++ b/scripts/libmakepkg/util/util.sh.in
@@ -42,15 +42,10 @@ is_array() {
 	local v=$1
 	local ret=1
 
-	# this function requires extglob - save current options to restore later
-	local shellopts=$(shopt -p)
-	shopt -s extglob
-
 	if [[ $(declare -p "$v") == declare\ -*([[:alnum:]])a*([[:alnum:]])\ * ]]; then
 		ret=0
 	fi
 
-	eval "$shellopts"
 	return $ret
 }
 
-- 
2.17.0


More information about the pacman-dev mailing list