[pacman-dev] [PATCH 7/7] libmakepkg: disallow using 'any' with other arches

Morgan Adamiec morganamilo at gmail.com
Sun Jun 24 01:24:04 UTC 2018


> Please append a version of you patch in the subject line. e.g.
> [PATCH 7/7 v3]

Eli gave me a little walk through on the best practises for patches,
next patches will include this.

> I'm still not happy with this patch.  Why not just explicitly check that
> "any" is specified on its own, rather than a check here and one in the
> following loop.
>
> if in_array "any" "${arch[@]}"; then
>         if (( ${#arch[@]} == 1 )); then
>                 return 0;
>         else
>                 error "$(gettext "...")"
>                 return 1;
>         fi
> fi

The explicit check will accept any on it's own but doesn't do anything
about mixing any and other architectures
The loop then makes sure any has not been snuck into the middle of the
depends array.

Without the former we would get: "pkgbase is not available for the
'any' architecture".
Without the latter "depends=('foo any bar)" would be valid. (and yes I
saw a package doing this once)

> Also, "any" should be %s in the error string as so it is not translated.
>  A better error message is:

> $(gettext "Can not use '%s' architecture with other architectures")" "any"

Done, as well as most of your other criticism.


More information about the pacman-dev mailing list