diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-05-20 08:59:05 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-05-29 23:53:24 +0200 |
commit | 41a535b6a5723add4a9fee0454f7baa988d063c5 (patch) | |
tree | 0d14d9e9743d142562a8b2cefb97ce434ec5e8b7 | |
parent | python-r1.eclass: python_setup, add REQUIRED_USE to the example (diff) | |
download | gentoo-41a535b6a5723add4a9fee0454f7baa988d063c5.tar.gz gentoo-41a535b6a5723add4a9fee0454f7baa988d063c5.tar.bz2 gentoo-41a535b6a5723add4a9fee0454f7baa988d063c5.zip |
distutils-r1.eclass: Use _python_impl_matches()
Update the missed occurence of pattern matching with the new framework.
-rw-r--r-- | eclass/distutils-r1.eclass | 17 |
1 files 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 |