libmakepkg: don't save/set/restore extglob in bash [[ tests
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> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
542c3cf812
commit
2b4c996b86
1 changed files with 0 additions and 5 deletions
|
@ -42,15 +42,10 @@ is_array() {
|
||||||
local v=$1
|
local v=$1
|
||||||
local ret=1
|
local ret=1
|
||||||
|
|
||||||
# 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
|
if [[ $(declare -p "$v") == declare\ -*([[:alnum:]])a*([[:alnum:]])\ * ]]; then
|
||||||
ret=0
|
ret=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
eval "$shellopts"
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue