libmakepkg: disallow using 'any' with other arches
Error if the arch array contains any and any other values. This also fixes a bug where the check for `$arch == 'any'` which only evaluated the first value in the array, meaning the rest of the values would not be linted. Signed-off-by: morganamilo <morganamilo@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
a5090217f9
commit
c15f7ae606
1 changed files with 7 additions and 2 deletions
|
@ -33,8 +33,13 @@ lint_pkgbuild_functions+=('lint_arch')
|
||||||
lint_arch() {
|
lint_arch() {
|
||||||
local a name list ret=0
|
local a name list ret=0
|
||||||
|
|
||||||
if [[ $arch == 'any' ]]; then
|
if in_array "any" "${arch[@]}"; then
|
||||||
return 0
|
if (( ${#arch[@]} == 1 )); then
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
error "$(gettext "Can not use '%s' architecture with other architectures")" "any"
|
||||||
|
return 1;
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for a in "${arch[@]}"; do
|
for a in "${arch[@]}"; do
|
||||||
|
|
Loading…
Add table
Reference in a new issue