commit:     744765284a62cff7626789446e7005a750652793
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  1 08:27:20 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar  8 07:35:45 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74476528

python-any-r1.eclass: Add integrity check for globals

 eclass/python-any-r1.eclass | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index d41cf6a5808..69f7bb736d2 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -57,8 +57,6 @@ fi
 
 EXPORT_FUNCTIONS pkg_setup
 
-if [[ ! ${_PYTHON_ANY_R1} ]]; then
-
 # @ECLASS-VARIABLE: PYTHON_COMPAT
 # @REQUIRED
 # @DESCRIPTION:
@@ -161,12 +159,23 @@ _python_any_set_globals() {
        done
        deps="|| ( ${deps})"
 
-       PYTHON_DEPS=${deps}
-       readonly PYTHON_DEPS
+       if [[ ${PYTHON_DEPS+1} ]]; then
+               if [[ ${PYTHON_DEPS} != "${deps}" ]]; then
+                       eerror "PYTHON_DEPS have changed between inherits 
(PYTHON_REQ_USE?)!"
+                       eerror "Before: ${PYTHON_DEPS}"
+                       eerror "Now   : ${deps}"
+                       die "PYTHON_DEPS integrity check failed"
+               fi
+       else
+               PYTHON_DEPS=${deps}
+               readonly PYTHON_DEPS
+       fi
 }
 _python_any_set_globals
 unset -f _python_any_set_globals
 
+if [[ ! ${_PYTHON_ANY_R1} ]]; then
+
 # @FUNCTION: python_gen_any_dep
 # @USAGE: <dependency-block>
 # @DESCRIPTION:

Reply via email to