Use the ebuild_phase helper function to calls phase hooks and fix broken
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:39:06 +0000 (07:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:39:06 +0000 (07:39 -0000)
trap calls that try to unset multiple signal handlers at once without
passing - as the first argument. (trunk r12805)

svn path=/main/branches/2.1.6/; revision=13039

bin/ebuild.sh

index fbccb3dc2a0d1c5cab3627ef05238ef4132e0f29..e2a79676506fa8dffdb2961b133fd7d26908d3df 100755 (executable)
@@ -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() {