Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFD: EAPI specification in ebuilds
Date: Thu, 08 Mar 2012 10:44:20
Message-Id: CAAr7Pr9HSxsDePhAKFvXPpK5U8NhdXADMAm79b7cW7Tf_QkW4w@mail.gmail.com
In Reply to: Re: [gentoo-dev] RFD: EAPI specification in ebuilds by Ulrich Mueller
1 On Wed, Mar 7, 2012 at 11:27 PM, Ulrich Mueller <ulm@g.o> wrote:
2 >>>>>> On Wed, 7 Mar 2012, Alec Warner wrote:
3 >
4 >>> *** Proposal 1: "Parse the EAPI assignment statement" ***
5 >>> [...]
6 >
7 >> I don't like this idea because the sane way should be easy and
8 >> straightforward. Mixing a constant declaration with bash assignment
9 >> just confuses users who think the assignment is full bash when in
10 >> fact it is not.
11 >
12 >> EAPI=$(somefunc)
13 >> EAPI=${SOMEVAR%%-*}
14 >> and so forth all don't meet the regex (and would be flagged
15 >> invalid.) However a naive author might think they work.
16 >
17 > Such constructs also cannot be used with any of the other proposed
18 > solutions. And in fact, nobody is using such things in practice.
19 > _All_ ebuilds in the Portage tree can be successfully parsed with the
20 > regexp proposed.
21
22 I'm not saying they are valid EAPI syntax; but they are all valid
23 bash. I tend to assume all authors are as...ignorant as myself. Lets
24 not give them the rope to hang themselves.
25
26 >
27 > The obvious sanity check, i.e. comparing the EAPI obtained by parsing
28 > and by sourcing, could be added to repoman, which would prevent such
29 > non-conforming ebuilds from being committed to the tree.
30 >
31 >>> *** Proposal 2: "EAPI in header comment" ***
32 >>> [...]
33 >
34 >> Overloading is bad.
35 >
36 >> There is no real difference between:
37 >> #!/usr/bin/ebuild --eapi 5
38 >> # EAPI=5
39 >
40 >> The problem is that the former is also the way to specify how to
41 >> execute the ebuild; so unless you plan to make ebuilds executable and
42 >> having /usr/bin/ebuild provide the ebuild environment, using that
43 >> syntax is confusing to users.
44 >
45 > I agree with this point.
46 >
47 > Many file formats are identifying themselves with a magic token (as
48 > it is used by sys-apps/file), but it is not necessarily a shebang.
49 >
50 > Ulrich
51 >

Replies

Subject Author
Re: [gentoo-dev] RFD: EAPI specification in ebuilds Zac Medico <zmedico@g.o>