Gentoo Archives: gentoo-java

From: Vlastimil Babka <caster@g.o>
To: gentoo-java@l.g.o
Subject: Re: [gentoo-java] generation-2 java eclass
Date: Sat, 16 Sep 2006 23:40:11
Message-Id: 450C8B52.8050707@gentoo.org
In Reply to: [gentoo-java] generation-2 java eclass by Alon Bar-Lev
1 Alon Bar-Lev wrote:
2 > Hello,
3 >
4 > Maybe you can help answering some questions I have regarding the
5 > generation-2 java eclass.
6 >
7 > I've seen that in openoffice ebuild there is no call to
8 > java-pkg-opt-2_pkg_setup fro pkg_setup, the reason is seems to be
9 > because it is called automatically.
10 >
11 > 1. Is there any documentation regarding portage phase hooks? I could
12 > not see any reference to this in eclass HOWTO guide.
13 >
14 It's a new feature of portage 2.1. See
15 /usr/share/doc/portage-<ver>/NEWS.gz. Not mentioned in eclass HOWTO
16 because it's not meant to be used by eclasses, but by users. Java eclass
17 is a exception, but we should stop using it when portage is able to save
18 env properly between phases (which should already be now IIRC?). It's
19 bad thing that now an user can override our phase hooks with
20 /etc/portage/bashrc.
21 > 2. It seems a bit strange that two eclasses can override the same
22 > function name... How such conflict is resolved?
23 >
24 Order of inheriting matters, the latter eclass overrides the former.
25 Ebuild inheriting conflicting eclasses should then override the function
26 itself and call the functions of both eclasses from there. Now if there
27 was a repoman check for that...
28 > 3. Looking at java-pkg-2.eclass I see function name
29 > pre_pkg-2_setup, shouldn't it be pre_pkg_setup? I see that
30 > pre_pkg_setup is specified in java-pkg-opt-2.eclass... Why is there a
31 > difference?
32 >
33 Must be a typo. As a result, java env is probably not set properly
34 inside ebuild's pkg_setup() (for ebuilds that define it). But since
35 there are correct hooks for other phases (especially src_compile) it
36 didn't cause any harm so far.
37 > 4. Can you please fix the documentation of java development and on
38 > the eclass it-self so that there will be a comment that the unlike
39 > other eclasses, java-pkg*-2_pkg_setup should not be called from
40 > pkg_setup?
41 >
42 Well, since the usage of phase hooks is only a workaround (not meant to
43 free ebuild writer from calling java-pkg*-2_pkg_setup, that's just a
44 consequence) I would say it's better to document that it should be
45 called from ebuild explicitly, so when we stop using the phase hooks
46 (and maybe it's time already?), number of ebuilds won't get broken
47 instantly.
48
49 Regards,
50 Vlastimil Babka
51
52 --
53 gentoo-java@g.o mailing list

Replies

Subject Author
Re: [gentoo-java] generation-2 java eclass Alon Bar-Lev <alon.barlev@×××××.com>