diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-05-19 18:11:48 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-05-29 23:53:41 +0200 |
commit | ec82e21c11d1b8ccb3e6bd7cf5fb530a099ecc48 (patch) | |
tree | 486ba572fbc9a9e476278c76b41a84e9c23db271 /eclass | |
parent | distutils-r1.eclass: Reuse python_setup for common phases (diff) | |
download | gentoo-ec82e21c11d1b8ccb3e6bd7cf5fb530a099ecc48.tar.gz gentoo-ec82e21c11d1b8ccb3e6bd7cf5fb530a099ecc48.tar.bz2 gentoo-ec82e21c11d1b8ccb3e6bd7cf5fb530a099ecc48.zip |
python-r1.eclass: Move PYTHON_COMPAT_OVERRIDE warning into flag check
Move the PYTHON_COMPAT_OVERRIDE warning from _python_obtain_impls()
to _python_validate_useflags(). Since the latter function is the only
point where the former is called, this is a purely cosmetic change at
the moment. However, it makes it possible to reuse the warning in
additional places without the necessity of setting MULTIBUILD_VARIANTS.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/python-r1.eclass | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 5eaa802e06b9..ae9e3806e729 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -242,10 +242,25 @@ if [[ ! ${_PYTHON_R1} ]]; then # @FUNCTION: _python_validate_useflags # @INTERNAL # @DESCRIPTION: -# Enforce the proper setting of PYTHON_TARGETS. +# Enforce the proper setting of PYTHON_TARGETS, if PYTHON_COMPAT_OVERRIDE +# is not in effect. If it is, just warn that the flags will be ignored. _python_validate_useflags() { debug-print-function ${FUNCNAME} "${@}" + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then + if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then + ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python" + ewarn "implementations will be enabled:" + ewarn + ewarn " ${PYTHON_COMPAT_OVERRIDE}" + ewarn + ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored." + _PYTHON_COMPAT_OVERRIDE_WARNED=1 + fi + # we do not use flags with PCO + return + fi + local i for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do @@ -490,23 +505,13 @@ python_copy_sources() { # @DESCRIPTION: # Set up the enabled implementation list. _python_obtain_impls() { - if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then - if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then - ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python" - ewarn "implementations will be enabled:" - ewarn - ewarn " ${PYTHON_COMPAT_OVERRIDE}" - ewarn - ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored." - _PYTHON_COMPAT_OVERRIDE_WARNED=1 - fi + _python_validate_useflags + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} ) return fi - _python_validate_useflags - MULTIBUILD_VARIANTS=() local impl |