Hi! On Fri, 15 May 2009, Ciaran McCreesh wrote: > > eval `grep '^EAPI=' ebuildfile | head -n 1` > > > > will set EAPI in the current scope to EAPI in the ebuild, without > > sourcing it, unless the issue with something like this would be its > > use of grep and head, but these are both in the system set, so unless > > you don't want to depend on the system set, I don't know what the > > objection would be. > > The objection is that your code doesn't work. It's entirely legal to > do, say: > > export EAPI="1"
Change the spec, then. Or aren't we talking about writing/changing/clarifying a spec right now? I mean... yes, ebuilds are actually bash scripts. But I don't see a problem with using a subset of what's allowed for *this* *specific* line. Actually, I personally would prefer taking it out of the parsed-by-bash part entirely. Add it as a shebang-like line at the top: #EAPI-1 as the first or second line. Allowing it on the second line allows you to later bolt on a true shebang-line if you should so desire. Only having to look at the first two lines makes finding it out easier (note that I don't call that parsing on purpose). > or: > > inherit versionator > > if version_is_at_least 2 ; then > EAPI="2" > else > EAPI="0" > fi I was under the impression that it's illegal to change/set the EAPI after using inherit. Regards, Tobias -- Found on a small utility knife in MIT's lab supply: "Caution. Blade is sharp. Keep out of children."