diff mbox

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

Message ID 20180502195436.20380-1-eschwartz@archlinux.org
State Accepted, archived
Headers show

Commit Message

Eli Schwartz May 2, 2018, 7:54 p.m. UTC
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@archlinux.org>
---
 scripts/libmakepkg/util/util.sh.in | 5 -----
 1 file changed, 5 deletions(-)
diff mbox

Patch

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
 }