From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 87E8C139694 for ; Sat, 20 May 2017 08:58:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CBBE4E0F1A; Sat, 20 May 2017 08:56:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8DA4FE0F16 for ; Sat, 20 May 2017 08:56:30 +0000 (UTC) Received: from localhost.localdomain (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 0AA9B3416D4; Sat, 20 May 2017 08:56:28 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 4/4] python-utils-r1.eclass: _python_impl_matches, handle both forms of impl Date: Sat, 20 May 2017 10:56:16 +0200 Message-Id: <20170520085616.5602-5-mgorny@gentoo.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170520085616.5602-1-mgorny@gentoo.org> References: <20170520085616.5602-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: a5e11b00-e84f-44bb-b748-4b2b1b6fc4ab X-Archives-Hash: 9ed09d967fbf8ac4ecf9c8c58f48c9c0 Make the pattern matching code in _python_impl_matches() more lax, allowing (accidental) mixing of PYTHON_COMPAT-style values with EPYTHON-style values. This is trivial to do, and solves the problem introduced by complexity-by-limitation of other eclasses -- where patterns for dependency strings are using PYTHON_COMPAT syntax, and patterns for python_setup are using EPYTHON syntax. --- eclass/python-utils-r1.eclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 0bf7e7ec1a3e..68fb9ba2578d 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -169,7 +169,8 @@ _python_set_impls() { # Check whether the specified matches at least one # of the patterns following it. Return 0 if it does, 1 otherwise. # -# should be in PYTHON_COMPAT form. The patterns can be either: +# can be in PYTHON_COMPAT or EPYTHON form. The patterns can be +# either: # a) fnmatch-style patterns, e.g. 'python2*', 'pypy'... # b) '-2' to indicate all Python 2 variants (= !python_is_python3) # c) '-3' to indicate all Python 3 variants (= python_is_python3) @@ -186,7 +187,8 @@ _python_impl_matches() { elif [[ ${pattern} == -3 ]]; then python_is_python3 "${impl}" return - elif [[ ${impl} == ${pattern} ]]; then + # unify value style to allow lax matching + elif [[ ${impl/./_} == ${pattern/./_} ]]; then return 0 fi done -- 2.13.0