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: Wed, 08 Mar 2017 07:36:18
Message-Id: 1488958550.9d683e6e8c036b5a2c61529a3c4c9c84295b62ba.mgorny@gentoo
1 commit: 9d683e6e8c036b5a2c61529a3c4c9c84295b62ba
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 1 09:08:20 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 8 07:35:50 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d683e6e
7
8 python-single-r1.eclass: Refactor global setter to use locals, NFC
9
10 eclass/python-single-r1.eclass | 20 ++++++++++++--------
11 1 file changed, 12 insertions(+), 8 deletions(-)
12
13 diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
14 index 84d1f067be1..85350924b65 100644
15 --- a/eclass/python-single-r1.eclass
16 +++ b/eclass/python-single-r1.eclass
17 @@ -180,7 +180,6 @@ if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
18 _python_single_set_globals() {
19 _python_set_impls
20
21 - PYTHON_DEPS=
22 local i PYTHON_PKG_DEP
23
24 local flags_mt=( "${_PYTHON_SUPPORTED_IMPLS[@]/#/python_targets_}" )
25 @@ -191,12 +190,13 @@ _python_single_set_globals() {
26
27 IUSE="${flags_mt[*]}"
28
29 + local deps requse usedep
30 if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then
31 # There is only one supported implementation; set IUSE and other
32 # variables without PYTHON_SINGLE_TARGET.
33 - PYTHON_REQUIRED_USE="${flags_mt[*]}"
34 + requse=${flags_mt[*]}
35 python_export "${_PYTHON_SUPPORTED_IMPLS[0]}" PYTHON_PKG_DEP
36 - PYTHON_DEPS="${flags_mt[*]}? ( ${PYTHON_PKG_DEP} ) "
37 + deps="${flags_mt[*]}? ( ${PYTHON_PKG_DEP} ) "
38 # Force on the python_single_target_* flag for this impl, so
39 # that any dependencies that inherit python-single-r1 and
40 # happen to have multiple implementations will still need
41 @@ -205,7 +205,7 @@ _python_single_set_globals() {
42 else
43 # Multiple supported implementations; honor PYTHON_SINGLE_TARGET.
44 IUSE+=" ${flags[*]}"
45 - PYTHON_REQUIRED_USE="^^ ( ${flags[*]} )"
46 + requse="^^ ( ${flags[*]} )"
47 # Ensure deps honor the same python_single_target_* flag as is set
48 # on this package.
49 optflags+=,${flags[@]/%/(+)?}
50 @@ -214,13 +214,13 @@ _python_single_set_globals() {
51 # The chosen targets need to be in PYTHON_TARGETS as well.
52 # This is in order to enforce correct dependencies on packages
53 # supporting multiple implementations.
54 - PYTHON_REQUIRED_USE+=" python_single_target_${i}? ( python_targets_${i} )"
55 + requse+=" python_single_target_${i}? ( python_targets_${i} )"
56
57 python_export "${i}" PYTHON_PKG_DEP
58 - PYTHON_DEPS+="python_single_target_${i}? ( ${PYTHON_PKG_DEP} ) "
59 + deps+="python_single_target_${i}? ( ${PYTHON_PKG_DEP} ) "
60 done
61 fi
62 - PYTHON_USEDEP=${optflags// /,}
63 + usedep=${optflags// /,}
64
65 # 1) well, python-exec would suffice as an RDEP
66 # but no point in making this overcomplex, BDEP doesn't hurt anyone
67 @@ -229,8 +229,12 @@ _python_single_set_globals() {
68 if [[ ${_PYTHON_WANT_PYTHON_EXEC2} == 0 ]]; then
69 die "python-exec:0 is no longer supported, please fix your ebuild to work with python-exec:2"
70 else
71 - PYTHON_DEPS+=">=dev-lang/python-exec-2:=[${PYTHON_USEDEP}]"
72 + deps+=">=dev-lang/python-exec-2:=[${usedep}]"
73 fi
74 +
75 + PYTHON_DEPS=${deps}
76 + PYTHON_REQUIRED_USE=${requse}
77 + PYTHON_USEDEP=${usedep}
78 readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP
79 }
80 _python_single_set_globals