Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 07/29] python-utils-r1.eclass: Make python_fix_shebang QAwarns fatal in EAPI 6
Date: Sun, 22 Nov 2015 19:57:31
Message-Id: 1448221870-17269-8-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCHES] Clean-up & EAPI 6 support for python-r1 suite by "Michał Górny"
1 ---
2 eclass/python-utils-r1.eclass | 14 ++++++++++----
3 1 file changed, 10 insertions(+), 4 deletions(-)
4
5 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
6 index 99ee58b..d8ced41 100644
7 --- a/eclass/python-utils-r1.eclass
8 +++ b/eclass/python-utils-r1.eclass
9 @@ -33,7 +33,8 @@ fi
10
11 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
12
13 -inherit eutils multilib toolchain-funcs
14 +[[ ${EAPI:-0} == [012345] ]] && inherit eutils
15 +inherit multilib toolchain-funcs
16
17 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
18 # @INTERNAL
19 @@ -1137,12 +1138,17 @@ python_fix_shebang() {
20 done < <(find "${path}" -type f -print0 || die)
21
22 if [[ ! ${any_fixed} ]]; then
23 - eqawarn "QA warning: ${FUNCNAME}, ${path#${D}} did not match any fixable files."
24 + local cmd=eerror
25 + [[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn
26 +
27 + "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D}} did not match any fixable files."
28 if [[ ${any_correct} ]]; then
29 - eqawarn "All files have ${EPYTHON} shebang already."
30 + "${cmd}" "All files have ${EPYTHON} shebang already."
31 else
32 - eqawarn "There are no Python files in specified directory."
33 + "${cmd}" "There are no Python files in specified directory."
34 fi
35 +
36 + [[ ${cmd} == eerror ]] && die "${FUNCNAME} did not match any fixable files (QA warning fatal in EAPI ${EAPI})"
37 fi
38 done
39 }
40 --
41 2.6.3