Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o, haubi@g.o
Cc: "Petteri Räty" <betelgeuse@g.o>
Subject: Re: [gentoo-dev] stacking profile.bashrc?
Date: Thu, 16 Jul 2009 18:56:18
Message-Id: 4A5F7756.9070702@gentoo.org
In Reply to: Re: [gentoo-dev] stacking profile.bashrc? by Michael Haubenwallner
1 Michael Haubenwallner wrote:
2 > On Wed, 2009-07-15 at 11:39 -0700, Zac Medico wrote:
3 >> Michael Haubenwallner wrote:
4 >
5 >>> We do have post_src_install() hook in profiles/prefix/profile.bashrc ...
6 >>> In profiles/prefix/aix/profiles.bashrc, there is another
7 >>> post_src_install() hook ...
8 >>> The problem now is that the latter post_src_install() overrides the
9 >>> former, ...
10 >
11 >> The pre/post phase hooks are not designed for this, they are only
12 >> intended for users to put in /etc/portage/bashrc. For what you are
13 >> trying to do, it seems like a registration interface would be more
14 >> appropriate (something like register_die_hook).
15 >
16 > Should this registration api be provided by portage, or by
17 > base/profile.bashrc?
18 > Hmm, will have to be portage, because /etc/portage/bashrc would override
19 > base/profile.bashrc too. base/profile.bashrc just might jump in when not
20 > provided by installed portage yet.
21 >
22 >> Maybe the usage
23 >> could go something like this:
24 >>
25 >> register_phase_hook install post my_post_src_install
26 >
27 > For readability, I'd more like to have 'post' in front of 'install'.
28 >
29 > Or eventually something like:
30 >
31 > register_phase_hook \
32 > --before-src_install my_pre_src_install_1 my_pre_src_install_2 \
33 > --after-src_install my_post_src_install_1 my_post_src_install_2 \
34 > --before-<phase-function-name> <multiple hooks>
35 >
36 > Or with phase-names instead of phase-function-names:
37 >
38 > register_phase_hook \
39 > --before-{setup,nofetch,unpack,prepare,configure,compile,...} <hooks> \
40 > --after-{...,test,install,preinst,postinst,prerm,postrm} <hooks>
41 >
42 > Suggesting "before&after" here as I'm always confused with
43 > pre_pkg_preinst, post_pkg_preinst, pre_pkg_postinst, post_pkg_postinst,
44 > pre_pkg_prerm, post_pkg_prerm, pre_pkg_postrm, post_pkg_prerm.
45 >
46 > Anyway: besides implementation, what else does it need to get this done?
47
48 The specification is really the most important part, and you have to
49 give the -dev community an opportunity to participate in refining
50 the spec (via RFC email, GLEP, or whatnot).
51
52 It seems like this idea will probably serve for bug 179800, which is
53 about allowing eclasses to register phase hooks:
54
55 http://bugs.gentoo.org/show_bug.cgi?id=179800
56
57 >
58 > Thank you!
59 >
60 > /haubi/
61
62
63 --
64 Thanks,
65 Zac

Replies

Subject Author
[gentoo-dev] Re: stacking profile.bashrc? Steven J Long <slong@××××××××××××××××××.uk>