Gentoo Archives: gentoo-dev

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] stacking profile.bashrc?
Date: Thu, 16 Jul 2009 07:17:05
Message-Id: 1247728620.1554.56.camel@salomon-22
In Reply to: Re: [gentoo-dev] stacking profile.bashrc? by Zac Medico
1 On Wed, 2009-07-15 at 11:39 -0700, Zac Medico wrote:
2 > Michael Haubenwallner wrote:
3
4 > > We do have post_src_install() hook in profiles/prefix/profile.bashrc ...
5 > > In profiles/prefix/aix/profiles.bashrc, there is another
6 > > post_src_install() hook ...
7 > > The problem now is that the latter post_src_install() overrides the
8 > > former, ...
9
10 > The pre/post phase hooks are not designed for this, they are only
11 > intended for users to put in /etc/portage/bashrc. For what you are
12 > trying to do, it seems like a registration interface would be more
13 > appropriate (something like register_die_hook).
14
15 Should this registration api be provided by portage, or by
16 base/profile.bashrc?
17 Hmm, will have to be portage, because /etc/portage/bashrc would override
18 base/profile.bashrc too. base/profile.bashrc just might jump in when not
19 provided by installed portage yet.
20
21 > Maybe the usage
22 > could go something like this:
23 >
24 > register_phase_hook install post my_post_src_install
25
26 For readability, I'd more like to have 'post' in front of 'install'.
27
28 Or eventually something like:
29
30 register_phase_hook \
31 --before-src_install my_pre_src_install_1 my_pre_src_install_2 \
32 --after-src_install my_post_src_install_1 my_post_src_install_2 \
33 --before-<phase-function-name> <multiple hooks>
34
35 Or with phase-names instead of phase-function-names:
36
37 register_phase_hook \
38 --before-{setup,nofetch,unpack,prepare,configure,compile,...} <hooks> \
39 --after-{...,test,install,preinst,postinst,prerm,postrm} <hooks>
40
41 Suggesting "before&after" here as I'm always confused with
42 pre_pkg_preinst, post_pkg_preinst, pre_pkg_postinst, post_pkg_postinst,
43 pre_pkg_prerm, post_pkg_prerm, pre_pkg_postrm, post_pkg_prerm.
44
45 Anyway: besides implementation, what else does it need to get this done?
46
47 Thank you!
48
49 /haubi/
50 --
51 Michael Haubenwallner
52 Gentoo on a different level

Replies

Subject Author
Re: [gentoo-dev] stacking profile.bashrc? Zac Medico <zmedico@g.o>