1 |
commit: a640c3d2a4846107fe3eac2d0f20b4fdcb3008c4 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 1 09:11:43 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 8 07:35:51 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a640c3d2 |
7 |
|
8 |
python-single-r1.eclass: Add integrity checks for globals |
9 |
|
10 |
eclass/python-single-r1.eclass | 36 ++++++++++++++++++++++++++++++------ |
11 |
1 file changed, 30 insertions(+), 6 deletions(-) |
12 |
|
13 |
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass |
14 |
index 85350924b65..fc51c4ec237 100644 |
15 |
--- a/eclass/python-single-r1.eclass |
16 |
+++ b/eclass/python-single-r1.eclass |
17 |
@@ -56,8 +56,6 @@ fi |
18 |
|
19 |
EXPORT_FUNCTIONS pkg_setup |
20 |
|
21 |
-if [[ ! ${_PYTHON_SINGLE_R1} ]]; then |
22 |
- |
23 |
# @ECLASS-VARIABLE: PYTHON_COMPAT |
24 |
# @REQUIRED |
25 |
# @DESCRIPTION: |
26 |
@@ -232,14 +230,40 @@ _python_single_set_globals() { |
27 |
deps+=">=dev-lang/python-exec-2:=[${usedep}]" |
28 |
fi |
29 |
|
30 |
- PYTHON_DEPS=${deps} |
31 |
- PYTHON_REQUIRED_USE=${requse} |
32 |
- PYTHON_USEDEP=${usedep} |
33 |
- readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP |
34 |
+ if [[ ${PYTHON_DEPS+1} ]]; then |
35 |
+ if [[ ${PYTHON_DEPS} != "${deps}" ]]; then |
36 |
+ eerror "PYTHON_DEPS have changed between inherits (PYTHON_REQ_USE?)!" |
37 |
+ eerror "Before: ${PYTHON_DEPS}" |
38 |
+ eerror "Now : ${deps}" |
39 |
+ die "PYTHON_DEPS integrity check failed" |
40 |
+ fi |
41 |
+ |
42 |
+ # these two are formality -- they depend on PYTHON_COMPAT only |
43 |
+ if [[ ${PYTHON_REQUIRED_USE} != ${requse} ]]; then |
44 |
+ eerror "PYTHON_REQUIRED_USE have changed between inherits!" |
45 |
+ eerror "Before: ${PYTHON_REQUIRED_USE}" |
46 |
+ eerror "Now : ${requse}" |
47 |
+ die "PYTHON_REQUIRED_USE integrity check failed" |
48 |
+ fi |
49 |
+ |
50 |
+ if [[ ${PYTHON_USEDEP} != "${usedep}" ]]; then |
51 |
+ eerror "PYTHON_USEDEP have changed between inherits!" |
52 |
+ eerror "Before: ${PYTHON_USEDEP}" |
53 |
+ eerror "Now : ${usedep}" |
54 |
+ die "PYTHON_USEDEP integrity check failed" |
55 |
+ fi |
56 |
+ else |
57 |
+ PYTHON_DEPS=${deps} |
58 |
+ PYTHON_REQUIRED_USE=${requse} |
59 |
+ PYTHON_USEDEP=${usedep} |
60 |
+ readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP |
61 |
+ fi |
62 |
} |
63 |
_python_single_set_globals |
64 |
unset -f _python_single_set_globals |
65 |
|
66 |
+if [[ ! ${_PYTHON_SINGLE_R1} ]]; then |
67 |
+ |
68 |
# @FUNCTION: python_gen_usedep |
69 |
# @USAGE: <pattern> [...] |
70 |
# @DESCRIPTION: |