From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: python@gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 3/4] distutils-r1.eclass: Use _python_impl_matches()
Date: Sat, 20 May 2017 10:56:15 +0200 [thread overview]
Message-ID: <20170520085616.5602-4-mgorny@gentoo.org> (raw)
In-Reply-To: <20170520085616.5602-1-mgorny@gentoo.org>
Update the missed occurence of pattern matching with the new framework.
---
eclass/distutils-r1.eclass | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 1376326c9579..6078fb6d52b7 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: distutils-r1.eclass
@@ -191,6 +191,12 @@ fi
# (allowing any implementation). If multiple values are specified,
# implementations matching any of the patterns will be accepted.
#
+# The patterns can be either fnmatch-style patterns (matched via bash
+# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
+# appropriately all enabled Python 2/3 implementations (alike
+# python_is_python3). Remember to escape or quote the fnmatch patterns
+# to prevent accidental shell filename expansion.
+#
# If the restriction needs to apply conditionally to a USE flag,
# the variable should be set conditionally as well (e.g. in an early
# phase function or other convenient location).
@@ -669,12 +675,9 @@ _distutils-r1_run_common_phase() {
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
local best_impl patterns=( "${DISTUTILS_ALL_SUBPHASE_IMPLS[@]-*}" )
_distutils_try_impl() {
- local pattern
- for pattern in "${patterns[@]}"; do
- if [[ ${EPYTHON} == ${pattern} ]]; then
- best_impl=${MULTIBUILD_VARIANT}
- fi
- done
+ if _python_impl_matches "${EPYTHON}" "${patterns[@]}"; then
+ best_impl=${MULTIBUILD_VARIANT}
+ fi
}
python_foreach_impl _distutils_try_impl
unset -f _distutils_try_impl
--
2.13.0
next prev parent reply other threads:[~2017-05-20 8:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-20 8:56 [gentoo-dev] [PATCHES] python-r1 suite: minor fixes Michał Górny
2017-05-20 8:56 ` [gentoo-dev] [PATCH 1/4] python-any-r1.eclass: python_gen_any_dep, add missing 'local i' Michał Górny
2017-05-20 8:56 ` [gentoo-dev] [PATCH 2/4] python-r1.eclass: python_setup, add REQUIRED_USE to the example Michał Górny
2017-05-20 8:56 ` Michał Górny [this message]
2017-05-20 8:56 ` [gentoo-dev] [PATCH 4/4] python-utils-r1.eclass: _python_impl_matches, handle both forms of impl Michał Górny
2017-06-06 6:59 ` [gentoo-dev] [PATCHES] python-r1 suite: minor fixes Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170520085616.5602-4-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=python@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox