Add more QA warnings for econf calls during unexpected phases. Thanks to
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:39:58 +0000 (07:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:39:58 +0000 (07:39 -0000)
Diego Elio Pettenò <flameeyes@g.o> for the suggestion. (trunk r12808)

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

bin/ebuild.sh

index e2a79676506fa8dffdb2961b133fd7d26908d3df..09bc8f960249c67e92bdc47b8932eabc50f7d0fc 100755 (executable)
@@ -468,9 +468,18 @@ hasgq() { hasg "$@" >/dev/null ; }
 econf() {
        local x
 
-       ! hasq "$EAPI" 0 1 && [[ $EBUILD_PHASE = compile && \
-               $(type -t src_configure) = function ]] && \
-               eqawarn "econf called in src_compile instead of src_configure"
+       local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
+       if [[ -n $phase_func ]] ; then
+               if hasq "$EAPI" 0 1 ; then
+                       [[ $phase_func != src_compile ]] && \
+                               eqawarn "QA Notice: econf called in" \
+                                       "$phase_func instead of src_compile"
+               else
+                       [[ $phase_func != src_configure ]] && \
+                               eqawarn "QA Notice: econf called in" \
+                                       "$phase_func instead of src_configure"
+               fi
+       fi
 
        : ${ECONF_SOURCE:=.}
        if [ -x "${ECONF_SOURCE}/configure" ]; then