Gentoo Archives: gentoo-dev

From: Sergey Popov <pinkbyte@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] rfc: calling all eclass phase functions by default
Date: Tue, 19 Aug 2014 06:58:31
Message-Id: 53F2F58C.3070004@gentoo.org
In Reply to: Re: [gentoo-dev] rfc: calling all eclass phase functions by default by hasufell
1 18.08.2014 16:56, hasufell пишет:
2 > hasufell:
3 >>
4 >> Even more interesting... you can work around this by inheriting
5 >> base.eclass explicitly before e.g. unpacker.eclass, something like
6 >>
7 >> inherit base unpacker games
8 >>
9 >> => unpacker_src_unpack() is carried out by default (and the ebuild
10 >> breaks if someone thinks the base.eclass is useless and removes it)
11 >>
12 >> inherit unpacker games
13 >>
14 >> => unpacker_src_unpack is not carried out by default although
15 >> games.eclass does not directly overwrite it
16 >>
17 >> If you think any of this is sensible...
18 >>
19 >
20 > Almost forgot, of course this does not work if you expect
21 > unpacker_src_unpacker() to run:
22 > inherit unpacker games base
23 >
24 > as well as
25 > inherit unpacker base games
26 >
27 > however
28 > inherit games unpacker base
29 >
30 > will work.
31 >
32 > And now... guess why the games herd made it a policy to always inherit
33 > games.eclass last. Because of the unpredictability of eclasses and that
34 > they may randomly add exported phase functions. It's a bit paranoid, but
35 > understandable, since we don't have any real rules here.
36 >
37 > So in the end 3 eclasses all tell you "inherit me last! really!". Good
38 > luck with figuring out how to make a gnome game with python and multilib
39 > support work together. I can predict the days such a review would take
40 > in #gentoo-sunrise. Not less than 3.
41 >
42
43 As i said early - always override necessary functions if you want
44 non-default behaviour. Proposed solution with variable just add syntax
45 sugar, doing the same thing.
46
47 As for you as sunrise reviewer. I am member of proxy maintainers, i am
48 also reviewing ebuilds from users. And they usually understands inherit
49 logic very well, even in non-trivial cases.
50
51 So, your expirience just differs with mine, not more, not less.
52
53 --
54 Best regards, Sergey Popov
55 Gentoo developer
56 Gentoo Desktop Effects project lead
57 Gentoo Proxy maintainers project lead

Attachments

File name MIME type
signature.asc application/pgp-signature