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 ebuild.sh of pre/post phase hooks.
3
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
7
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
12
13 for example.
14 setup, unpack, compile, test, install, preinst, postinst, prerm,
15 postrm, and config via this patch have pre/post hooks.
16
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.
20
21 So... it's in users interests to convert over to this setup sooner
22 rather then later.
23
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).
26
27 That said, their will be an exemption for java ebuilds due to the fact
28 that they're blocked by ebuild.sh 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.
32
33 Either way, play with it, feedback would be appreciated.
34 ~harring

Attachments

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

Replies