* Tomáš Chvátal <[email protected]>:
> Dne pondělí 21 Září 2009 18:03:56 Torsten Veller napsal(a):
> > * Tomáš Chvátal <[email protected]>:
> > > I think it is not required
> > > EXPF="src_compile src_test src_install" <- definition, also nulls
> > > anything what was in it before :]
> > > case ${EAPI:-0} in
> > > 2) EXPF="${EXPF} src_configure" ;;
> > > 1|0) ;;
> > > *) die "Unknown EAPI, Bug eclass maintainers." ;;
> > > esac
> > > EXPORT_FUNCTIONS ${EXPF} <- export
> >
> > And later in cmake-utils_src_compile you use:
> > | has src_configure ${EXPF} || cmake-utils_src_configure
> >
> > What will happen if an EAPI=2 ebuild inherits cmake-utils and another
> > eclass also using EXPF that does not EXPORT_FUNCTIONS src_configure and
> > the ebuild uses cmake-utils_src_compile?
> >
> > It will call cmake-utils_src_configure during src_configure and later in
> > cmake-utils_src_compile it will run cmake-utils_src_configure again,
> > won't it?
> >
> You dont do this magic before inherits, so you are safe, if you inherit in
> middle of your eclass code, then you probably deserve the breakage for
> writting such horrible thing ;]
I'am trying to give an example:
,----- test.eclass
EXPF=pkg_postinst
EXPORT_FUNCTIONS ${EXPF}
test_pkg_postinst() {
einfo test_pkg_postinst
}
'----- test.eclass
,----- another_test.eclass
EXPF="src_configure src_compile"
EXPORT_FUNCTIONS ${EXPF}
another_test_src_configure() {
einfo another_test_src_configure
}
another_test_src_compile() {
einfo another_test_src_compile
has src_configure ${EXPF} || another_test_src_configure
}
'----- another_test.eclass
,----- test.ebuild
EAPI=2
inherit another_test test
DESCRIPTION=""
HOMEPAGE=""
SRC_URI=""
LICENSE=""
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
'----- test.ebuild
It outputs:
* another_test_src_configure
* another_test_src_compile
* another_test_src_configure
* test_pkg_postinst
if s/EXPF/TEST_EXPF/ in test.eclass, it does:
* another_test_src_configure
* another_test_src_compile
* test_pkg_postinst