Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH eutils] Introduce has_iuse() for IUSE checks.
Date: Wed, 14 Sep 2011 15:20:40
Message-Id: CAJaTeTrnQcNdWGM+O07QBC6Pgy83gw9+3azpTsuVT39Ri7gTjA@mail.gmail.com
In Reply to: Re: [gentoo-dev] [PATCH eutils] Introduce has_iuse() for IUSE checks. by Ciaran McCreesh
On Wed, Sep 14, 2011 at 01:18, Ciaran McCreesh wrote:
> On Tue, 13 Sep 2011 10:29:48 -0400 Mike Frysinger wrote: >> > You don't do it by checking IUSE. You do it by having the ebuild >> > define a variable like WANT_MONKEY_SUPPORT. >> >> it's a crap shoot.  as long as Michał's proposed func doesnt attempt >> to make guarantees that don't exist now, i think it's fine.  we have >> ebuilds/eclasses that are already using it, so unifying it purely for >> the [+-] cleanup makes sense to me. > > Providing a function, especially in eutils, makes people think that it > will work. It won't work, so the solution is to fix ebuilds and > eclasses that are doing it and make sure people realise why they can't > do that.
it depends on the context. in global scope, eclasses cant leverage IUSE from the ebuild. this is semi-obvious, and you provided some illustrative examples. however, why wont this work sanely in src_* or pkg_* funcs ? the env there is the one constructed by the PM which includes the merged IUSE values. and it should work sanely for eclasses/ebuilds checking their own IUSE. toolchain.eclass for example does just this ... based on the version of gcc the eclass is being used, it selectively adds flags to IUSE. then the rest of the eclass tests that for available functionality rather than copying & pasting version limits all over. granted toolchain.eclass isnt the norm, but if it's going to work there, it has to work in general. -mike

Replies

Subject Author
Re: [gentoo-dev] [PATCH eutils] Introduce has_iuse() for IUSE checks. Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>