Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 04/10] python-any-r1.eclass: Add integrity check for globals
Date: Wed, 01 Mar 2017 16:06:08
Message-Id: 20170301160249.11287-5-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCHES] python-r1, add integrity checks for redefined control vars by "Michał Górny"
1 ---
2 eclass/python-any-r1.eclass | 17 +++++++++++++----
3 1 file changed, 13 insertions(+), 4 deletions(-)
4
5 diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
6 index d41cf6a5808d..69f7bb736d22 100644
7 --- a/eclass/python-any-r1.eclass
8 +++ b/eclass/python-any-r1.eclass
9 @@ -57,8 +57,6 @@ fi
10
11 EXPORT_FUNCTIONS pkg_setup
12
13 -if [[ ! ${_PYTHON_ANY_R1} ]]; then
14 -
15 # @ECLASS-VARIABLE: PYTHON_COMPAT
16 # @REQUIRED
17 # @DESCRIPTION:
18 @@ -161,12 +159,23 @@ _python_any_set_globals() {
19 done
20 deps="|| ( ${deps})"
21
22 - PYTHON_DEPS=${deps}
23 - readonly PYTHON_DEPS
24 + if [[ ${PYTHON_DEPS+1} ]]; then
25 + if [[ ${PYTHON_DEPS} != "${deps}" ]]; then
26 + eerror "PYTHON_DEPS have changed between inherits (PYTHON_REQ_USE?)!"
27 + eerror "Before: ${PYTHON_DEPS}"
28 + eerror "Now : ${deps}"
29 + die "PYTHON_DEPS integrity check failed"
30 + fi
31 + else
32 + PYTHON_DEPS=${deps}
33 + readonly PYTHON_DEPS
34 + fi
35 }
36 _python_any_set_globals
37 unset -f _python_any_set_globals
38
39 +if [[ ! ${_PYTHON_ANY_R1} ]]; then
40 +
41 # @FUNCTION: python_gen_any_dep
42 # @USAGE: <dependency-block>
43 # @DESCRIPTION:
44 --
45 2.12.0