From 8958e4cc1f7623916c25dfe081ca74524cd90f11 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 9 Mar 2009 09:45:28 +0000 Subject: Use the ebuild_phase helper function to calls phase hooks and fix broken trap calls that try to unset multiple signal handlers at once without passing - as the first argument. svn path=/main/trunk/; revision=12805 --- bin/ebuild.sh | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 0c3a20a5..3c31c87d 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -680,14 +680,12 @@ dyn_unpack() { install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'" fi cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`" - [ "$(type -t pre_src_unpack)" == "function" ] && qa_call pre_src_unpack + ebuild_phase pre_src_unpack vecho ">>> Unpacking source..." ebuild_phase src_unpack touch "${PORTAGE_BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in ${PORTAGE_BUILDDIR}" vecho ">>> Source unpacked in ${WORKDIR}" - cd "${PORTAGE_BUILDDIR}" - - [ "$(type -t post_src_unpack)" == "function" ] && qa_call post_src_unpack + ebuild_phase post_src_unpack } dyn_clean() { @@ -814,7 +812,7 @@ abort_handler() { echo eval ${3} #unset signal handler - trap SIGINT SIGQUIT + trap - SIGINT SIGQUIT } abort_prepare() { @@ -872,7 +870,7 @@ dyn_prepare() { vecho ">>> Source prepared." ebuild_phase post_src_prepare - trap SIGINT SIGQUIT + trap - SIGINT SIGQUIT } dyn_configure() { @@ -885,18 +883,16 @@ dyn_configure() { trap abort_configure SIGINT SIGQUIT - [[ $(type -t pre_src_configure) = function ]] && \ - qa_call pre_src_configure + ebuild_phase pre_src_configure vecho ">>> Configuring source in $srcdir ..." ebuild_phase src_configure touch "$PORTAGE_BUILDDIR"/.configured vecho ">>> Source configured." - [[ $(type -t post_src_configure) = function ]] && \ - qa_call post_src_configure + ebuild_phase post_src_configure - trap SIGINT SIGQUIT + trap - SIGINT SIGQUIT } dyn_compile() { @@ -909,17 +905,16 @@ dyn_compile() { trap abort_compile SIGINT SIGQUIT - [[ $(type -t pre_src_compile) = function ]] && \ - qa_call pre_src_compile + ebuild_phase pre_src_compile vecho ">>> Compiling source in ${srcdir} ..." ebuild_phase src_compile touch "$PORTAGE_BUILDDIR"/.compiled vecho ">>> Source compiled." - [ "$(type -t post_src_compile)" == "function" ] && qa_call post_src_compile + ebuild_phase post_src_compile - trap SIGINT SIGQUIT + trap - SIGINT SIGQUIT } dyn_test() { @@ -929,7 +924,7 @@ dyn_test() { # like it's supposed to here. ! hasq test ${USE} && export USE="${USE} test" fi - [ "$(type -t pre_src_test)" == "function" ] && qa_call pre_src_test + ebuild_phase pre_src_test if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then vecho ">>> It appears that ${PN} has already been tested; skipping." return @@ -951,10 +946,10 @@ dyn_test() { SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}" fi - cd "${PORTAGE_BUILDDIR}" - touch .tested || die "Failed to 'touch .tested' in ${PORTAGE_BUILDDIR}" - [ "$(type -t post_src_test)" == "function" ] && qa_call post_src_test - trap SIGINT SIGQUIT + touch "$PORTAGE_BUILDDIR/.tested" || \ + die "Failed to 'touch .tested' in $PORTAGE_BUILDDIR" + ebuild_phase post_src_test + trap - SIGINT SIGQUIT } dyn_install() { @@ -967,7 +962,7 @@ dyn_install() { return 0 fi trap "abort_install" SIGINT SIGQUIT - [ "$(type -t pre_src_install)" == "function" ] && qa_call pre_src_install + ebuild_phase pre_src_install rm -rf "${PORTAGE_BUILDDIR}/image" mkdir "${PORTAGE_BUILDDIR}/image" if [ -d "${S}" ]; then @@ -996,8 +991,7 @@ dyn_install() { touch "${PORTAGE_BUILDDIR}/.installed" vecho ">>> Completed installing ${PF} into ${D}" vecho - cd ${PORTAGE_BUILDDIR} - [ "$(type -t post_src_install)" == "function" ] && qa_call post_src_install + ebuild_phase post_src_install cd "${PORTAGE_BUILDDIR}"/build-info set -f @@ -1029,7 +1023,7 @@ dyn_install() { then touch DEBUGBUILD fi - trap SIGINT SIGQUIT + trap - SIGINT SIGQUIT } dyn_preinst() { -- cgit v1.2.3-65-gdbad