Gentoo Archives: gentoo-dev

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] A new glep: Ebuild format and metadata handling
Date: Wed, 03 Jun 2009 10:02:33
Message-Id: 1244023348.1633.93.camel@salomon-22
In Reply to: [gentoo-dev] A new glep: Ebuild format and metadata handling by Patrick Lauer
1 On Sun, 2009-05-31 at 15:56 +0200, Patrick Lauer wrote:
2
3 Thank you for collecting this up!
4
5 > parsers: The current practise of putting the eapi definition near the top of
6 > the ebuild, combined with the need to state it for all non-EAPI0 ebuilds,
7 > suggests that it can be parsed without having to source the ebuild.
8
9 Would it improve parsers' performance to explicitly define EAPI="0" in
10 EAPI0 ebuilds too, so it always can find an EAPI value?
11
12 > "haubi"
13 > He proposes to use an eapi.eclass and define eapi as a function.
14
15 Erm, unlike earlier I did not propose eapi as a function this time.
16
17 Instead, my proposal is identical to the "parsers" one, but with a
18 backwards compatible syntax for defining the EAPI value that allows to
19 have non-parsing PMs (nearly) silently ignore the ebuild, so we do not
20 have to wait another extended period (=year) to put "parsed" EAPI values
21 in the tree after a "parsing" PM became stable.
22
23 This backwards compatibility syntax is done with the eapi.eclass, which
24 does nothing but early exit when inherit'ed by an old (=non-parsing) PM.
25
26 It is up to the "parsing" PM (the PMS) if 'eapi.eclass' actually gets
27 read in, as the implementation of 'inherit' is part of the PM and has to
28 detect "eapi" as special argument anyway, otherways it would fail to
29 find "4.eclass" when used this way:
30 > inherit eapi 4
31
32 But I can also think of this syntax:
33 EAPI="4" # parsers read this line only
34 inherit eapi # compat for non-parsing PM only
35
36 Here the 'inherit eapi' line can be dropped as soon as we do not need to
37 support non-parsing PMs any more. However, parsing PMs either need to
38 ignore "eapi" as argument to 'inherit', or need to inform eapi.eclass
39 somehow that the EAPI was parsed already.
40 There might be a better name than 'eapi.eclass' here. With
41 'eapicompat.eclass' fex this would read:
42 EAPI="4"
43 inherit eapicompat
44
45 Thanks!
46
47 /haubi/
48 --
49 Michael Haubenwallner
50 Gentoo on a different level