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).

-- 
Best regards,
Michał Górny



Reply via email to