diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-03-01 10:11:43 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-03-08 08:35:51 +0100 |
commit | a640c3d2a4846107fe3eac2d0f20b4fdcb3008c4 (patch) | |
tree | 48fc84bccc1704245839f35d2e588b8fc6124385 /eclass/python-single-r1.eclass | |
parent | python-single-r1.eclass: Refactor global setter to use locals, NFC (diff) | |
download | gentoo-a640c3d2a4846107fe3eac2d0f20b4fdcb3008c4.tar.gz gentoo-a640c3d2a4846107fe3eac2d0f20b4fdcb3008c4.tar.bz2 gentoo-a640c3d2a4846107fe3eac2d0f20b4fdcb3008c4.zip |
python-single-r1.eclass: Add integrity checks for globals
Diffstat (limited to 'eclass/python-single-r1.eclass')
-rw-r--r-- | eclass/python-single-r1.eclass | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index 85350924b657..fc51c4ec2377 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -56,8 +56,6 @@ fi EXPORT_FUNCTIONS pkg_setup -if [[ ! ${_PYTHON_SINGLE_R1} ]]; then - # @ECLASS-VARIABLE: PYTHON_COMPAT # @REQUIRED # @DESCRIPTION: @@ -232,14 +230,40 @@ _python_single_set_globals() { deps+=">=dev-lang/python-exec-2:=[${usedep}]" fi - PYTHON_DEPS=${deps} - PYTHON_REQUIRED_USE=${requse} - PYTHON_USEDEP=${usedep} - readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP + 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 + + # these two are formality -- they depend on PYTHON_COMPAT only + if [[ ${PYTHON_REQUIRED_USE} != ${requse} ]]; then + eerror "PYTHON_REQUIRED_USE have changed between inherits!" + eerror "Before: ${PYTHON_REQUIRED_USE}" + eerror "Now : ${requse}" + die "PYTHON_REQUIRED_USE integrity check failed" + fi + + if [[ ${PYTHON_USEDEP} != "${usedep}" ]]; then + eerror "PYTHON_USEDEP have changed between inherits!" + eerror "Before: ${PYTHON_USEDEP}" + eerror "Now : ${usedep}" + die "PYTHON_USEDEP integrity check failed" + fi + else + PYTHON_DEPS=${deps} + PYTHON_REQUIRED_USE=${requse} + PYTHON_USEDEP=${usedep} + readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP + fi } _python_single_set_globals unset -f _python_single_set_globals +if [[ ! ${_PYTHON_SINGLE_R1} ]]; then + # @FUNCTION: python_gen_usedep # @USAGE: <pattern> [...] # @DESCRIPTION: |