libmakepkg/util: use parameter transformation when checking variable type

Now that we require bash 4.4 this is "more correct" than analyzing the
output of declare -p to see if it compares favorably with -a.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Eli Schwartz 2018-06-19 16:26:35 -04:00 committed by Allan McRae
parent b0a8f44f10
commit 92bc0a4740

View file

@ -42,7 +42,7 @@ is_array() {
local v=$1
local ret=1
if [[ $(declare -p "$v") == declare\ -*([[:alnum:]])a*([[:alnum:]])\ * ]]; then
if [[ ${!v@a} = *a* ]]; then
ret=0
fi