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

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


On Sun, 24 Jun 2018 at 02:31, Allan McRae <allan at archlinux.org> wrote:
>
> On 24/06/18 11:24, Morgan Adamiec wrote:
> >> 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)
> >
>
> And what does the code I provided above do?
>
> A

Oh right sorry. I thought it was an extract from my patch for some
reason and glossed over it. I'll use this instead.


More information about the pacman-dev mailing list