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: Mon, 29 May 2017 21:54:11
Message-Id: 1496094821.ec82e21c11d1b8ccb3e6bd7cf5fb530a099ecc48.mgorny@gentoo
1 commit: ec82e21c11d1b8ccb3e6bd7cf5fb530a099ecc48
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 19 16:11:48 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon May 29 21:53:41 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec82e21c
7
8 python-r1.eclass: Move PYTHON_COMPAT_OVERRIDE warning into flag check
9
10 Move the PYTHON_COMPAT_OVERRIDE warning from _python_obtain_impls()
11 to _python_validate_useflags(). Since the latter function is the only
12 point where the former is called, this is a purely cosmetic change at
13 the moment. However, it makes it possible to reuse the warning in
14 additional places without the necessity of setting MULTIBUILD_VARIANTS.
15
16 eclass/python-r1.eclass | 31 ++++++++++++++++++-------------
17 1 file changed, 18 insertions(+), 13 deletions(-)
18
19 diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
20 index 5eaa802e06b..ae9e3806e72 100644
21 --- a/eclass/python-r1.eclass
22 +++ b/eclass/python-r1.eclass
23 @@ -242,10 +242,25 @@ if [[ ! ${_PYTHON_R1} ]]; then
24 # @FUNCTION: _python_validate_useflags
25 # @INTERNAL
26 # @DESCRIPTION:
27 -# Enforce the proper setting of PYTHON_TARGETS.
28 +# Enforce the proper setting of PYTHON_TARGETS, if PYTHON_COMPAT_OVERRIDE
29 +# is not in effect. If it is, just warn that the flags will be ignored.
30 _python_validate_useflags() {
31 debug-print-function ${FUNCNAME} "${@}"
32
33 + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
34 + if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then
35 + ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python"
36 + ewarn "implementations will be enabled:"
37 + ewarn
38 + ewarn " ${PYTHON_COMPAT_OVERRIDE}"
39 + ewarn
40 + ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored."
41 + _PYTHON_COMPAT_OVERRIDE_WARNED=1
42 + fi
43 + # we do not use flags with PCO
44 + return
45 + fi
46 +
47 local i
48
49 for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
50 @@ -490,23 +505,13 @@ python_copy_sources() {
51 # @DESCRIPTION:
52 # Set up the enabled implementation list.
53 _python_obtain_impls() {
54 - if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
55 - if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then
56 - ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python"
57 - ewarn "implementations will be enabled:"
58 - ewarn
59 - ewarn " ${PYTHON_COMPAT_OVERRIDE}"
60 - ewarn
61 - ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored."
62 - _PYTHON_COMPAT_OVERRIDE_WARNED=1
63 - fi
64 + _python_validate_useflags
65
66 + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
67 MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
68 return
69 fi
70
71 - _python_validate_useflags
72 -
73 MULTIBUILD_VARIANTS=()
74
75 local impl