On Mon, Aug 6, 2018 at 3:51 PM, Mike Gilbert <floppym@gentoo.org> wrote:
On Mon, Aug 6, 2018 at 3:35 PM Vadim A. Misbakh-Soloviov
<gentoo@mva.name> wrote:
>
> В письме от понедельник, 6 августа 2018 г. 22:13:49 MSK пользователь Ulrich
> Mueller написал:
> > >>>>> On Mon, 6 Aug 2018, Mike Gilbert wrote:
> > > -DEPEND="virtual/pkgconfig"
> > > +if [[ ${EAPI} == [0123456] ]]; then
> >
> > This should use ${EAPI:-0} because for EAPI 0 the variable can be
> > empty.
> >
> > > +   DEPEND="virtual/pkgconfig"
> > > +else
> > > +   BDEPEND="virtual/pkgconfig"
> > > +fi
>
> And how about "-le"/"-lt"/"-ge"/"-gt"/"-eq" syntax?
> Or even ((EAPI<7))?
> Are they forbidden to use in eclasses?

If I recall correctly, EAPI values are not required to be numeric, and
are not required to increase in any predictable manner. They only do
so by convention.

They do not even do so by convention; there are numerous EAPIs in the wild that are non-numeric.

-A
 

> Anyway, I think, it is possible to add something like "EAPI=${EAPI:-0}"
> somewhere at the top of eclass, to don't call "${EAPI:-0}" each time when EAPI
> variable is needed.

Re-assigning EAPI within an eclass seems like a bad idea to me.

A better solution would be to ban ebuilds with no defined EAPI, but
that's outside the scope of this patch.