1 |
Alon Bar-Lev wrote: |
2 |
> Thanks for explaining that. |
3 |
> |
4 |
>>> 2. It seems a bit strange that two eclasses can override the same |
5 |
>>> function name... How such conflict is resolved? |
6 |
>> Order of inheriting matters, the latter eclass overrides the |
7 |
>> former. Ebuild inheriting conflicting eclasses should then override |
8 |
>> the function itself and call the functions of both eclasses from |
9 |
>> there. Now if there was a repoman check for that... |
10 |
> |
11 |
> Right... But since, as you said, the elcass should not use the pre |
12 |
> stuff, it should not be a problem. |
13 |
|
14 |
Maybe you're confusing pre_hooks with usual function overriding done via |
15 |
EXPORT_FUNCTIONS (see eclass howto). I just explained the EXPORT |
16 |
overriding. For conflicting pre_hooks, I was only told that user defined |
17 |
hook beats eclass. |
18 |
|
19 |
>>> 3. Looking at java-pkg-2.eclass I see function name |
20 |
>>> pre_pkg-2_setup, shouldn't it be pre_pkg_setup? I see that |
21 |
>>> pre_pkg_setup is specified in java-pkg-opt-2.eclass... Why is |
22 |
>>> there a difference? |
23 |
>> Must be a typo. As a result, java env is probably not set properly |
24 |
>> inside ebuild's pkg_setup() (for ebuilds that define it). But since |
25 |
>> there are correct hooks for other phases (especially src_compile) |
26 |
>> it didn't cause any harm so far. |
27 |
> |
28 |
> Should I open a bug for it, or you can fix it? |
29 |
|
30 |
I can fix it but I just found out that portage seems to ignore |
31 |
pre_pkg_setup() hook anyway. Will need to talk to portage people if |
32 |
that's feature or bug. |
33 |
|
34 |
> |
35 |
>>> 4. Can you please fix the documentation of java development and |
36 |
>>> on the eclass it-self so that there will be a comment that the |
37 |
>>> unlike other eclasses, java-pkg*-2_pkg_setup should not be called |
38 |
>>> from pkg_setup? |
39 |
>> Well, since the usage of phase hooks is only a workaround (not |
40 |
>> meant to free ebuild writer from calling java-pkg*-2_pkg_setup, |
41 |
>> that's just a consequence) I would say it's better to document that |
42 |
>> it should be called from ebuild explicitly, so when we stop using |
43 |
>> the phase hooks (and maybe it's time already?), number of ebuilds |
44 |
>> won't get broken instantly. |
45 |
> |
46 |
> Right, I think so too. |
47 |
> So people should be told to call the pkg_setup. |
48 |
> |
49 |
> For example openoffice ebuild removed the call to |
50 |
> java-pkg*-2_pkg_setup since it is already called. |
51 |
> History is on bug#139340. |
52 |
> |
53 |
|
54 |
For now we decided to rely on the phase hooks (as nichoj told me), so no |
55 |
need to call pkg_setup. The hooks behaviour in portage can even change |
56 |
so that they will stack and not override, means we might stay with them. |
57 |
Not decided yet, so no rush to go fix ebuilds that work with current setup. |
58 |
|
59 |
-- |
60 |
Vlastimil Babka (Caster) |
61 |
Gentoo/Java |
62 |
-- |
63 |
gentoo-java@g.o mailing list |