From d0733a19ea2b08984589c5881b0a99c2ca26e4d6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 6 Dec 2009 10:22:54 +0000 Subject: Bug #295715 - Implement a register_success_hook function to complement register_die_hook, and also add code to ensure the die hooks are called even when the failure is on the python side (like for file collisions). svn path=/main/trunk/; revision=14936 --- bin/ebuild.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin/ebuild.sh') diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 3a203860d..6915296bf 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -267,6 +267,14 @@ register_die_hook() { done } +register_success_hook() { + local x + for x in $* ; do + hasq $x $EBUILD_SUCCESS_HOOKS || \ + export EBUILD_SUCCESS_HOOKS="$EBUILD_SUCCESS_HOOKS $x" + done +} + # Ensure that $PWD is sane whenever possible, to protect against # exploitation of insecure search path for python -c in ebuilds. # See bug #239560. @@ -741,7 +749,8 @@ dyn_clean() { if [[ $EMERGE_FROM = binary ]] || ! hasq keepwork $FEATURES; then rm -f "$PORTAGE_BUILDDIR"/.{ebuild_changed,exit_status,logid,unpacked,prepared} \ - "$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} + "$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} \ + "$PORTAGE_BUILDDIR"/.die_hooks rm -rf "${PORTAGE_BUILDDIR}/build-info" rm -rf "${WORKDIR}" -- cgit v1.2.3-1-g7c22