Gentoo Archives: gentoo-portage-dev

From: Brian Harring <ferringb@g.o>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] pre/post phase hooks for users
Date: Tue, 11 Oct 2005 08:06:06
Message-Id: 20051011080511.GC23821@nightcrawler
1 Since axxo is being a slacker (:-P) and hasn't posted this, did a
2 quicky implentation for stable of pre/post phase hooks.
4 The intention of these hooks are for users to define funcs in their
5 /etc/portage/bashrc; the phase to be hooked, say pkg_setup , is hooked
6 via
8 echo $'
9 pre_pkg_setup() { echo "I am called prior to pkg_setup"; }
10 post_pkg_setup() { echo "I am called after pkg_setup"; }
11 ' >> /etc/portage/bashrc
13 for example.
14 setup, unpack, compile, test, install, preinst, postinst, prerm,
15 postrm, and config via this patch have pre/post hooks.
17 This hooking approach is preferred to just sticking stuff in bashrc
18 and having it detect the phase- reasoning is that the bashrc will be
19 sourced once, and only once when ebd is default.
21 So... it's in users interests to convert over to this setup sooner
22 rather then later.
24 Note also, that these hooks aren't phase additions- ebuilds/eclasses
25 are not to touch them (this will be enforced under ebd also).
27 That said, their will be an exemption for java ebuilds due to the fact
28 that they're blocked by env handling- they need ebd for
29 things to work properly, and in the meantime this gives them a method
30 to have things work properly. Downside is that the pre/post hooks are
31 not available for users for java ebuilds.
33 Either way, play with it, feedback would be appreciated.
34 ~harring


File name MIME type
pre-post-phase-hooks.patch text/plain