Gentoo Archives: gentoo-dev

From: Torsten Veller <ml-en@××××××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: perl-module.class review
Date: Mon, 21 Sep 2009 16:55:38
Message-Id: 20090921184314.TA97f50.tv@veller.net
In Reply to: Re: [gentoo-dev] Re: perl-module.class review by "Tomáš Chvátal"
1 * Tomáš Chvátal <scarabeus@g.o>:
2 > Dne pondělí 21 Září 2009 18:03:56 Torsten Veller napsal(a):
3 > > * Tomáš Chvátal <scarabeus@g.o>:
4 > > > I think it is not required
5 > > > EXPF="src_compile src_test src_install" <- definition, also nulls
6 > > > anything what was in it before :]
7 > > > case ${EAPI:-0} in
8 > > > 2) EXPF="${EXPF} src_configure" ;;
9 > > > 1|0) ;;
10 > > > *) die "Unknown EAPI, Bug eclass maintainers." ;;
11 > > > esac
12 > > > EXPORT_FUNCTIONS ${EXPF} <- export
13 > >
14 > > And later in cmake-utils_src_compile you use:
15 > > | has src_configure ${EXPF} || cmake-utils_src_configure
16 > >
17 > > What will happen if an EAPI=2 ebuild inherits cmake-utils and another
18 > > eclass also using EXPF that does not EXPORT_FUNCTIONS src_configure and
19 > > the ebuild uses cmake-utils_src_compile?
20 > >
21 > > It will call cmake-utils_src_configure during src_configure and later in
22 > > cmake-utils_src_compile it will run cmake-utils_src_configure again,
23 > > won't it?
24 > >
25 > You dont do this magic before inherits, so you are safe, if you inherit in
26 > middle of your eclass code, then you probably deserve the breakage for
27 > writting such horrible thing ;]
28
29 I'am trying to give an example:
30
31 ,----- test.eclass
32 EXPF=pkg_postinst
33 EXPORT_FUNCTIONS ${EXPF}
34
35 test_pkg_postinst() {
36 einfo test_pkg_postinst
37 }
38 '----- test.eclass
39
40 ,----- another_test.eclass
41 EXPF="src_configure src_compile"
42 EXPORT_FUNCTIONS ${EXPF}
43
44 another_test_src_configure() {
45 einfo another_test_src_configure
46 }
47 another_test_src_compile() {
48 einfo another_test_src_compile
49 has src_configure ${EXPF} || another_test_src_configure
50 }
51 '----- another_test.eclass
52
53 ,----- test.ebuild
54 EAPI=2
55 inherit another_test test
56
57 DESCRIPTION=""
58 HOMEPAGE=""
59 SRC_URI=""
60
61 LICENSE=""
62 SLOT="0"
63 KEYWORDS="~amd64"
64 IUSE=""
65
66 '----- test.ebuild
67
68 It outputs:
69
70 * another_test_src_configure
71 * another_test_src_compile
72 * another_test_src_configure
73 * test_pkg_postinst
74
75 if s/EXPF/TEST_EXPF/ in test.eclass, it does:
76
77 * another_test_src_configure
78 * another_test_src_compile
79 * test_pkg_postinst

Replies

Subject Author
Re: [gentoo-dev] Re: perl-module.class review Jeremy Olexa <darkside@g.o>