On 06/11/2018 04:53 PM, morganamilo wrote:
> 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 <morganam...@gmail.com>
> ---
>  scripts/libmakepkg/lint_pkgbuild/arch.sh.in | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/libmakepkg/lint_pkgbuild/arch.sh.in 
> b/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
> index f2c80c73..8a1d2c11 100644
> --- a/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
> +++ b/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
> @@ -38,11 +38,16 @@ lint_arch() {
>               return 1
>       fi
>  
> -     if [[ $arch == 'any' ]]; then
> +     if [[ $arch == 'any' && ${#arch[@]} == 1 ]]; then


[[ ${#arch[@]} = 1 ]] is a string comparison (the test keyword or
builtin uses -eq to handle numeric values).

(( ${#arch[@]} == 1 )) is an integer comparison (shell arithmetic is
generally superior when available).

I specifically mentioned the latter in my previous email.

-- 
Eli Schwartz
Bug Wrangler and Trusted User

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to