Only execute src_test pre/post hooks when src_test is actually executed.
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:40:10 +0000 (07:40 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:40:10 +0000 (07:40 -0000)
(trunk r12809)

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

bin/ebuild.sh

index 09bc8f960249c67e92bdc47b8932eabc50f7d0fc..9d3428349d0fa45322396d30baea2f56c00021b6 100755 (executable)
@@ -933,7 +933,6 @@ dyn_test() {
                # like it's supposed to here.
                ! hasq test ${USE} && export USE="${USE} test"
        fi
-       ebuild_phase pre_src_test
        if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then
                vecho ">>> It appears that ${PN} has already been tested; skipping."
                return
@@ -951,13 +950,14 @@ dyn_test() {
                vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}"
        else
                addpredict /
+               ebuild_phase pre_src_test
                ebuild_phase src_test
+               touch "$PORTAGE_BUILDDIR/.tested" || \
+                       die "Failed to 'touch .tested' in $PORTAGE_BUILDDIR"
+               ebuild_phase post_src_test
                SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}"
        fi
 
-       touch "$PORTAGE_BUILDDIR/.tested" || \
-               die "Failed to 'touch .tested' in $PORTAGE_BUILDDIR"
-       ebuild_phase post_src_test
        trap - SIGINT SIGQUIT
 }