[pacman-dev] [PATCH 5/7] libmakepkg: disallow using any as an architecture specific variable
morganamilo
morganamilo at gmail.com
Fri Jun 8 18:18:57 UTC 2018
Signed-off-by: morganamilo <morganamilo at gmail.com>
---
scripts/libmakepkg/lint_pkgbuild/variable.sh.in | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
index b9264768..6b7da4a2 100644
--- a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
@@ -57,12 +57,15 @@ lint_variable() {
done
for a in ${arch[@]}; do
- [[ $a == "any" ]] && continue
-
for i in ${arch_array[@]}; do
v="${i}_${a}"
eval "keys=(\"\${!${v}[@]}\")"
if (( ${#keys[*]} > 0 )); then
+ if [[ $a == "any" ]]; then
+ error "$(gettext "%s_%s any can not be used for an architecture specific variable")" "$i" "$a"
+ ret=1
+ fi
+
if ! is_array $v; then
error "$(gettext "%s_%s should be an array")" "$i" "$a"
ret=1
@@ -111,6 +114,11 @@ lint_variable() {
for i in ${array[@]}; do
if extract_function_variable "package_$pkg" "${i}_${a}" 1 out; then
+ if [[ $a == "any" ]]; then
+ error "$(gettext "%s_%s any can not be used for an architecture specific variable")" "$i" "$a"
+ ret=1
+ fi
+
error "$(gettext "%s_%s can not be architecture specific")" "$i" "$a"
ret=1
fi
--
2.17.1
More information about the pacman-dev
mailing list