1 |
commit: 9e00927e4e20b7fa70428bef2e491142816e48ef |
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: Sat Nov 28 19:09:06 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e00927e |
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 236df89..d8bcb13 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 |
} |