index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz@archlinux.org> | 2018-06-12 21:17:17 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-01-10 15:21:13 +1000 |
commit | 30e3e21e873b01b98ab91dc1252d4112d6a9fd2a (patch) | |
tree | bfd6b5a83e2edc27014e55b694e9c53803b5cd2e /scripts/libmakepkg | |
parent | 03d85763e08cbe7c5ef1f9863cf25e026ee2756f (diff) |
-rw-r--r-- | scripts/libmakepkg/lint_pkgbuild/variable.sh.in | 16 |
diff --git a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in index 5f783e83..1ee3c834 100644 --- a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in @@ -38,12 +38,11 @@ lint_variable() { source) local string=(changelog epoch install pkgbase pkgdesc pkgrel pkgver url) - local i a v pkg keys out bad ret=0 + local i a pkg out bad ret=0 # global variables for i in ${array[@]} ${arch_array[@]}; do - eval "keys=(\"\${!$i[@]}\")" - if (( ${#keys[*]} > 0 )); then + if declare -p $i > /dev/null 2>&1; then if ! is_array $i; then error "$(gettext "%s should be an array")" "$i" ret=1 @@ -55,11 +54,9 @@ lint_variable() { [[ $a == "any" ]] && continue for i in ${arch_array[@]}; do - v="${i}_${a}" - eval "keys=(\"\${!${v}[@]}\")" - if (( ${#keys[*]} > 0 )); then - if ! is_array $v; then - error "$(gettext "%s_%s should be an array")" "$i" "$a" + if declare -p "${i}_${a}" > /dev/null 2>&1; then + if ! is_array ${i}_${a}; then + error "$(gettext "%s should be an array")" "${i}_${a}" ret=1 fi fi @@ -67,8 +64,7 @@ lint_variable() { done for i in ${string[@]}; do - eval "keys=(\"\${!$i[@]}\")" - if (( ${#keys[*]} > 0 )); then + if declare -p "$i" > /dev/null 2>&1; then if is_array $i; then error "$(gettext "%s should not be an array")" "$i" ret=1 |