python-utils-r1.eclass: Make python_fix_shebang QAwarns fatal in EAPI 6
authorMichał Górny <mgorny@gentoo.org>
Wed, 18 Nov 2015 19:30:10 +0000 (20:30 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sat, 28 Nov 2015 19:09:06 +0000 (20:09 +0100)
eclass/python-utils-r1.eclass

index 236df89c12e5d054629732394b5c23a71c0a182a..d8bcb138113a6ecfb0ce09e1ff7e4f27f8c6a497 100644 (file)
@@ -33,7 +33,8 @@ fi
 
 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
 
-inherit eutils multilib toolchain-funcs
+[[ ${EAPI:-0} == [012345] ]] && inherit eutils
+inherit multilib toolchain-funcs
 
 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
 # @INTERNAL
@@ -1142,12 +1143,17 @@ python_fix_shebang() {
                done < <(find -H "${path}" -type f -print0 || die)
 
                if [[ ! ${any_fixed} ]]; then
-                       eqawarn "QA warning: ${FUNCNAME}, ${path#${D}} did not match any fixable files."
+                       local cmd=eerror
+                       [[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn
+
+                       "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D}} did not match any fixable files."
                        if [[ ${any_correct} ]]; then
-                               eqawarn "All files have ${EPYTHON} shebang already."
+                               "${cmd}" "All files have ${EPYTHON} shebang already."
                        else
-                               eqawarn "There are no Python files in specified directory."
+                               "${cmd}" "There are no Python files in specified directory."
                        fi
+
+                       [[ ${cmd} == eerror ]] && die "${FUNCNAME} did not match any fixable files (QA warning fatal in EAPI ${EAPI})"
                fi
        done
 }