On Thu, Jun 17, 2021 at 7:02 AM Ulrich Mueller <u...@gentoo.org> wrote:
> >>>>> On Thu, 17 Jun 2021, Michał Górny wrote:
> > On Thu, 2021-06-17 at 12:10 +0200, Ulrich Mueller wrote:
> >> > > > > > On Thu, 17 Jun 2021, David Michael wrote:
> >> > @@ -33,15 +34,12 @@ _FCAPS_ECLASS=1
> >> >
> >> >  IUSE="+filecaps"
> >> >
> >> > -# Since it is needed in pkg_postinst() it must be in RDEPEND
> >> > +# Since it is needed in pkg_postinst() it must be in IDEPEND
> >> >  case "${EAPI:-0}" in
> >> > -  [0-6])
> >> > -          RDEPEND="filecaps? ( sys-libs/libcap )"
> >> > -  ;;
> >> > -  *)
> >> > -          BDEPEND="filecaps? ( sys-libs/libcap )"
> >> > -          RDEPEND="${BDEPEND}"
> >> > -  ;;
> >> > +  7) BDEPEND="filecaps? ( sys-libs/libcap )" ;&
> >>
> >> This is ill-defined in old EAPIs (5 and before), so the case statement
> >> may fail. You cannot use ;& in global scope of an eclass.
> >>
> >> Why not just change * to 7, and add a new case for 8? It's one
> >> additional line, and IMHO would be better readable than having a
> >> fallthrough.
>
> > I've already left a comment on the PR suggesting to split it into two
> > cases: one to check for valid EAPI, the other for deps.  It would be
> > cleaner IMO, as the second case would cover all future EAPIs via *,
> > and the first one would prevent the syntax error from applying to old
> > EAPIs (I've tested that).
>
> That would work too. But please add a comment making it clear that there
> is a fallthrough.

I've updated https://github.com/gentoo/gentoo/pull/21239 with this.

Thanks.

David

Reply via email to