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:00
Message-Id: 1496094804.41a535b6a5723add4a9fee0454f7baa988d063c5.mgorny@gentoo
1 commit: 41a535b6a5723add4a9fee0454f7baa988d063c5
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 20 06:59:05 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon May 29 21:53:24 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41a535b6
7
8 distutils-r1.eclass: Use _python_impl_matches()
9
10 Update the missed occurence of pattern matching with the new framework.
11
12 eclass/distutils-r1.eclass | 17 ++++++++++-------
13 1 file changed, 10 insertions(+), 7 deletions(-)
14
15 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
16 index 1376326c957..6078fb6d52b 100644
17 --- a/eclass/distutils-r1.eclass
18 +++ b/eclass/distutils-r1.eclass
19 @@ -1,4 +1,4 @@
20 -# Copyright 1999-2016 Gentoo Foundation
21 +# Copyright 1999-2017 Gentoo Foundation
22 # Distributed under the terms of the GNU General Public License v2
23
24 # @ECLASS: distutils-r1.eclass
25 @@ -191,6 +191,12 @@ fi
26 # (allowing any implementation). If multiple values are specified,
27 # implementations matching any of the patterns will be accepted.
28 #
29 +# The patterns can be either fnmatch-style patterns (matched via bash
30 +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
31 +# appropriately all enabled Python 2/3 implementations (alike
32 +# python_is_python3). Remember to escape or quote the fnmatch patterns
33 +# to prevent accidental shell filename expansion.
34 +#
35 # If the restriction needs to apply conditionally to a USE flag,
36 # the variable should be set conditionally as well (e.g. in an early
37 # phase function or other convenient location).
38 @@ -669,12 +675,9 @@ _distutils-r1_run_common_phase() {
39 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
40 local best_impl patterns=( "${DISTUTILS_ALL_SUBPHASE_IMPLS[@]-*}" )
41 _distutils_try_impl() {
42 - local pattern
43 - for pattern in "${patterns[@]}"; do
44 - if [[ ${EPYTHON} == ${pattern} ]]; then
45 - best_impl=${MULTIBUILD_VARIANT}
46 - fi
47 - done
48 + if _python_impl_matches "${EPYTHON}" "${patterns[@]}"; then
49 + best_impl=${MULTIBUILD_VARIANT}
50 + fi
51 }
52 python_foreach_impl _distutils_try_impl
53 unset -f _distutils_try_impl