Gentoo Archives: gentoo-dev

From: David Leverton <levertond@××××××××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFD: EAPI specification in ebuilds
Date: Wed, 07 Mar 2012 22:05:26
In Reply to: Re: [gentoo-dev] RFD: EAPI specification in ebuilds by Alexis Ballier
On 7 March 2012 21:07, Alexis Ballier <aballier@g.o> wrote:
> As i understand it, $PM will need to try the regexp tingy on any ebuild > anyway, guess the EAPI then source the ebuild with the right sourcer > to get the real EAPI and compare it.
Not exactly... the idea with proposal 2) is that the header comment becomes the One True Way to set the EAPI, so it wouldn't be "guessing" as such, and ebuilds wouldn't be allowed to change it during sourcing any more than they can redefine PV or the like. As mentioned, 2b) still risks a mismatch between the header and the assignment, but hopefully that would be temporary and the assignments could be dropped eventually. (And I'd suggest that the header EAPI is still considered authoritative if present - the mismatch check should probably be a hard error, or if not it should generate a warning and use the header value. There should be minimal if any risk of this changing behaviour for any existing ebuild, since existing ebuilds almost certainly won't match the chosen header syntax.) As for my opinion, I would prefer 2a), or 2b) as a second choice. IMHO it's much simpler and cleaner to come up with a strict, well-defined header format than to try and work within (an arbitrarily restricted version of) bash syntax.