Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:python-eapi6 commit in: eclass/
Date: Fri, 27 Nov 2015 13:17:10
Message-Id: 1448629514.f8e1755f039b44a1dd787080cea6190b5b117976.mgorny@gentoo
1 commit: f8e1755f039b44a1dd787080cea6190b5b117976
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 18 19:30:10 2015 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 27 13:05:14 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8e1755f
7
8 python-utils-r1.eclass: Make python_fix_shebang QAwarns fatal in EAPI 6
9
10 eclass/python-utils-r1.eclass | 14 ++++++++++----
11 1 file changed, 10 insertions(+), 4 deletions(-)
12
13 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
14 index d4c38f2..d9cb4ad 100644
15 --- a/eclass/python-utils-r1.eclass
16 +++ b/eclass/python-utils-r1.eclass
17 @@ -33,7 +33,8 @@ fi
18
19 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
20
21 -inherit eutils multilib toolchain-funcs
22 +[[ ${EAPI:-0} == [012345] ]] && inherit eutils
23 +inherit multilib toolchain-funcs
24
25 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
26 # @INTERNAL
27 @@ -1142,12 +1143,17 @@ python_fix_shebang() {
28 done < <(find -H "${path}" -type f -print0 || die)
29
30 if [[ ! ${any_fixed} ]]; then
31 - eqawarn "QA warning: ${FUNCNAME}, ${path#${D}} did not match any fixable files."
32 + local cmd=eerror
33 + [[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn
34 +
35 + "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D}} did not match any fixable files."
36 if [[ ${any_correct} ]]; then
37 - eqawarn "All files have ${EPYTHON} shebang already."
38 + "${cmd}" "All files have ${EPYTHON} shebang already."
39 else
40 - eqawarn "There are no Python files in specified directory."
41 + "${cmd}" "There are no Python files in specified directory."
42 fi
43 +
44 + [[ ${cmd} == eerror ]] && die "${FUNCNAME} did not match any fixable files (QA warning fatal in EAPI ${EAPI})"
45 fi
46 done
47 }