Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 08 Mar 2017 07:36:26
Message-Id: 1488958548.bc3e1df73bf55eeba8c113ca42f87e981866b1e0.mgorny@gentoo
1 commit: bc3e1df73bf55eeba8c113ca42f87e981866b1e0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 1 08:57:12 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 8 07:35:48 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc3e1df7
7
8 python-r1.eclass: Add integrity checks for globals
9
10 eclass/python-r1.eclass | 42 +++++++++++++++++++++++++++++++++++++-----
11 1 file changed, 37 insertions(+), 5 deletions(-)
12
13 diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
14 index 856f7554dd5..df57cf1e132 100644
15 --- a/eclass/python-r1.eclass
16 +++ b/eclass/python-r1.eclass
17 @@ -51,6 +51,8 @@ fi
18 [[ ${EAPI} == [45] ]] && inherit eutils
19 inherit multibuild python-utils-r1
20
21 +fi
22 +
23 # @ECLASS-VARIABLE: PYTHON_COMPAT
24 # @REQUIRED
25 # @DESCRIPTION:
26 @@ -198,15 +200,45 @@ _python_set_globals() {
27 deps+=">=dev-lang/python-exec-2:=[${usedep}]"
28 fi
29
30 - PYTHON_DEPS=${deps}
31 - IUSE=${flags[*]}
32 - PYTHON_REQUIRED_USE=${requse}
33 - PYTHON_USEDEP=${usedep}
34 - readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP
35 + if [[ ${PYTHON_DEPS+1} ]]; then
36 + # IUSE is magical, so we can't really check it
37 + # (but we verify PYTHON_COMPAT already)
38 +
39 + if [[ ${PYTHON_DEPS} != "${deps}" ]]; then
40 + eerror "PYTHON_DEPS have changed between inherits (PYTHON_REQ_USE?)!"
41 + eerror "Before: ${PYTHON_DEPS}"
42 + eerror "Now : ${deps}"
43 + die "PYTHON_DEPS integrity check failed"
44 + fi
45 +
46 + # these two are formality -- they depend on PYTHON_COMPAT only
47 + if [[ ${PYTHON_REQUIRED_USE} != ${requse} ]]; then
48 + eerror "PYTHON_REQUIRED_USE have changed between inherits!"
49 + eerror "Before: ${PYTHON_REQUIRED_USE}"
50 + eerror "Now : ${requse}"
51 + die "PYTHON_REQUIRED_USE integrity check failed"
52 + fi
53 +
54 + if [[ ${PYTHON_USEDEP} != "${usedep}" ]]; then
55 + eerror "PYTHON_USEDEP have changed between inherits!"
56 + eerror "Before: ${PYTHON_USEDEP}"
57 + eerror "Now : ${usedep}"
58 + die "PYTHON_USEDEP integrity check failed"
59 + fi
60 + else
61 + IUSE=${flags[*]}
62 +
63 + PYTHON_DEPS=${deps}
64 + PYTHON_REQUIRED_USE=${requse}
65 + PYTHON_USEDEP=${usedep}
66 + readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP
67 + fi
68 }
69 _python_set_globals
70 unset -f _python_set_globals
71
72 +if [[ ! ${_PYTHON_R1} ]]; then
73 +
74 # @FUNCTION: _python_validate_useflags
75 # @INTERNAL
76 # @DESCRIPTION: