Fix RESTRICT=test message for bug #469332.
authorZac Medico <zmedico@gentoo.org>
Sat, 18 May 2013 23:24:58 +0000 (16:24 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 18 May 2013 23:24:58 +0000 (16:24 -0700)
bin/phase-functions.sh

index ea717fe7caf37f06db6a40735ff1798e06c85fff..6d75ef10fee3152b7d0f20b01a57893f282963ce 100644 (file)
@@ -461,12 +461,6 @@ __dyn_test() {
                return
        fi
 
-       if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ $PORTAGE_IUSE ]]; then
-               # If USE came from ${T}/environment then it might not have USE=test
-               # like it's supposed to here.
-               ! has test ${USE} && export USE="${USE} test"
-       fi
-
        trap "__abort_test" SIGINT SIGQUIT
        if [ -d "${S}" ]; then
                cd "${S}"
@@ -474,12 +468,22 @@ __dyn_test() {
                cd "${WORKDIR}"
        fi
 
-       if ! has test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
-               __vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
-       elif has test $RESTRICT; then
+       if has test ${RESTRICT} ; then
                einfo "Skipping make test/check due to ebuild restriction."
-               __vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}"
+               __vecho ">>> Test phase [disabled because of RESTRICT=test]: ${CATEGORY}/${PF}"
+
+       # If ${EBUILD_FORCE_TEST} == 1 and FEATURES came from ${T}/environment
+       # then it might not have FEATURES=test like it's supposed to here.
+       elif [[ ${EBUILD_FORCE_TEST} != 1 ]] && ! has test ${FEATURES} ; then
+               __vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
        else
+               # If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
+               # then it might not have USE=test like it's supposed to here.
+               if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ ${PORTAGE_IUSE} ]] && \
+                       ! has test ${USE} ; then
+                       export USE="${USE} test"
+               fi
+
                local save_sp=${SANDBOX_PREDICT}
                addpredict /
                __ebuild_phase pre_src_test