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: Thu, 26 Nov 2015 22:35:43
Message-Id: 1448577169.a8fe129a0fef28d8782a4752384df3df9e820a29.mgorny@gentoo
1 commit: a8fe129a0fef28d8782a4752384df3df9e820a29
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: Thu Nov 26 22:32:49 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8fe129a
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 e467d27..e92e9d0 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 @@ -1140,12 +1141,17 @@ python_fix_shebang() {
28 done < <(find -H "${path}" -type f "${find_args[@]}" -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 }