index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz@archlinux.org> | 2018-04-03 17:48:14 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2018-04-29 21:49:05 +1000 |
commit | 91b72cc386ca03241791748da5da2b150c724ace (patch) | |
tree | acd1519d07a1a3eeb6913ba7bd2606edb00e263f /scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in | |
parent | bcaf1b84ff0f0709d35cd0adb1f13965d1101aeb (diff) |
-rw-r--r-- | scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in | 28 |
diff --git a/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in b/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in index 7758334c..87e561cb 100644 --- a/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in @@ -33,31 +33,13 @@ lint_pkgbuild_functions+=('lint_optdepends') lint_optdepends() { local a list name optdepends_list ret=0 - optdepends_list=("${optdepends[@]}") - for a in "${arch[@]}"; do - array_build list "optdepends_$a" - optdepends_list+=("${list[@]}") - done - - for name in "${pkgname[@]}"; do - if extract_function_variable "package_$name" optdepends 1 list; then - optdepends_list+=("${list[@]}") - fi + local optdepends_list optdepend name ret=0 - for a in "${arch[@]}"; do - if extract_function_variable "package_$name" "optdepends_$a" 1 list; then - optdepends_list+=("${list[@]}") - fi - done - done + get_pkgbuild_all_split_attributes optdepends optdepends_list - for name in "${optdepends_list[@]}"; do - local pkg=${name%%:[[:space:]]*} - # the '-' character _must_ be first or last in the character range - if [[ $pkg != +([-[:alnum:]><=.+_:]) ]]; then - error "$(gettext "Invalid syntax for %s: '%s'")" "optdepend" "$name" - ret=1 - fi + for optdepend in "${optdepends_list[@]}"; do + name=${optdepend%%:[[:space:]]*} + lint_one_pkgname optdepends "$name" || ret=1 done return $ret |