Gentoo Archives: gentoo-dev

From: Doug Klima <cardoe@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] EAPI placement
Date: Wed, 12 Dec 2007 01:04:13
Message-Id: 475F32C3.5040606@gentoo.org
In Reply to: Re: [gentoo-dev] EAPI placement by Marius Mauch
1 Marius Mauch wrote:
2 > On Tue, 11 Dec 2007 16:59:28 -0500
3 > Doug Klima <cardoe@g.o> wrote:
4 >
5 >> Since it doesn't appear the question was answered by the last thread.
6 >> I'm starting a new thread.
7 >
8 > The only sane solution I can think of is that eclasses shouldn't be
9 > allowed to change EAPI, but use conditionals to behave differently if
10 > needed. Mixing two (or more) different arbitrary EAPIs isn't going to
11 > work as after the inital parsing package managers will only see the
12 > last EAPI value anyway. Also there is no guarantee that future EAPI
13 > versions will be backwards compatible, so if eclasses could have an
14 > EAPI version it would eventually require that all packages using it
15 > need the same EAPI version (similar for nested inheritance).
16 >
17 > It's trivial to let inherit check that an eclass doesn't modify EAPI,
18 > and adding the conditional code to eclasses isn't difficult either:
19 >
20 > foo.eclass:
21 >
22 > if [ -z "$EAPI" ]; then
23 > inherit foo-eapi0
24 > fi
25 > case "$EAPI" in
26 > 0)
27 > inherit foo-eapi0
28 > ;;
29 > 1|2)
30 > inherit foo-eapi1_2
31 > ;;
32 > *)
33 > eerror "foo.eclass: unsupported EAPI value $EAPI"
34 > ;;
35 > esac
36 >
37 > # EAPI independent code here
38 >
39 > Obviously instead of specific eclasses one could also inline the
40 > relevant code. The only two issues I see in this concept are the
41 > eventual multiplication of eclasses and the lack of proper error
42 > handling for unsupported EAPIs.
43 >
44 > Marius
45 >
46 > PS: Yes, this idea has been mentioned in the old thread as well
47 >
48
49 This again leads to in a sense, code duplication due to the fact that
50 you have to have several different versions of the code for each EAPI.
51 When you could simply have $pkg_manager execute an eclass as 1 EAPI,
52 another eclass as another and the ebuild as a third EAPI and simplify it
53 for the eclass maintenance.
54
55 --
56 Doug Klima <cardoe@g.o>
57 http://dev.gentoo.org/~cardoe/
58 --
59 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] EAPI placement Marius Mauch <genone@g.o>