From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QdhKN-0003y2-7o for garchives@archives.gentoo.org; Mon, 04 Jul 2011 11:28:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 60EBF21C0A5; Mon, 4 Jul 2011 11:28:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1CA7021C0A5 for ; Mon, 4 Jul 2011 11:28:27 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3FA60641FF for ; Mon, 4 Jul 2011 11:28:26 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2256) id 03D1D2004B; Mon, 4 Jul 2011 11:28:25 +0000 (UTC) From: "Dirkjan Ochtman (djc)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, djc@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: python.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: python.eclass X-VCS-Directories: eclass X-VCS-Committer: djc X-VCS-Committer-Name: Dirkjan Ochtman Content-Type: text/plain; charset=utf8 Message-Id: <20110704112825.03D1D2004B@flycatcher.gentoo.org> Date: Mon, 4 Jul 2011 11:28:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 9eb95f17164d02f783efdef10670b3f3 djc 11/07/04 11:28:25 Modified: python.eclass Log: Pass Python ABI patterns list to _python_check_python_abi_matching() to simplify some code. (Patch by Arfrever. Backported from python overlay.= ) Revision Changes Path 1.117 eclass/python.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.ecla= ss?rev=3D1.117&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.ecla= ss?rev=3D1.117&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.ecla= ss?r1=3D1.116&r2=3D1.117 Index: python.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/python.eclass,v retrieving revision 1.116 retrieving revision 1.117 diff -u -r1.116 -r1.117 --- python.eclass 4 Jul 2011 11:27:53 -0000 1.116 +++ python.eclass 4 Jul 2011 11:28:24 -0000 1.117 @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.116 2011/07/= 04 11:27:53 djc Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.117 2011/07/= 04 11:28:24 djc Exp $ =20 # @ECLASS: python.eclass # @MAINTAINER: @@ -708,9 +708,7 @@ _python_initial_sanity_checks =20 if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" !=3D "declare -x PYTHON_= ABIS=3D"* ]] && has "${EAPI:-0}" 0 1 2 3 4; then - local PYTHON_ABI restricted_ABI restricted_ABIs support_ABI supported_= PYTHON_ABIS - - restricted_ABIs=3D"${RESTRICT_PYTHON_ABIS// /$'\n'}" + local PYTHON_ABI =20 if [[ "$(declare -p USE_PYTHON 2> /dev/null)" =3D=3D "declare -x USE_P= YTHON=3D"* ]]; then local cpython_enabled=3D"0" @@ -728,14 +726,9 @@ cpython_enabled=3D"1" fi =20 - support_ABI=3D"1" - while read restricted_ABI; do - if _python_check_python_abi_matching "${PYTHON_ABI}" "${restricted_= ABI}"; then - support_ABI=3D"0" - break - fi - done <<< "${restricted_ABIs}" - [[ "${support_ABI}" =3D=3D "1" ]] && export PYTHON_ABIS+=3D"${PYTHON= _ABIS:+ }${PYTHON_ABI}" + if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI= }" "${RESTRICT_PYTHON_ABIS}"; then + export PYTHON_ABIS+=3D"${PYTHON_ABIS:+ }${PYTHON_ABI}" + fi done =20 if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then @@ -761,21 +754,17 @@ =20 python2_version=3D"$("${EPREFIX}/usr/bin/python2" -c 'from sys impor= t version_info; print(".".join(str(x) for x in version_info[:2]))')" =20 + support_python_major_version=3D"0" for PYTHON_ABI in "${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]}"; do - support_python_major_version=3D"1" - while read restricted_ABI; do - if _python_check_python_abi_matching "${PYTHON_ABI}" "${restricted= _ABI}"; then - support_python_major_version=3D"0" - fi - done <<< "${restricted_ABIs}" - [[ "${support_python_major_version}" =3D=3D "1" ]] && break + if ! _python_check_python_abi_matching --patterns-list "${PYTHON_AB= I}" "${RESTRICT_PYTHON_ABIS}"; then + support_python_major_version=3D"1" + break + fi done if [[ "${support_python_major_version}" =3D=3D "1" ]]; then - while read restricted_ABI; do - if _python_check_python_abi_matching "${python2_version}" "${restr= icted_ABI}"; then - die "Active version of CPython 2 is not supported by ${CATEGORY}/= ${PF}" - fi - done <<< "${restricted_ABIs}" + if _python_check_python_abi_matching --patterns-list "${python2_ver= sion}" "${RESTRICT_PYTHON_ABIS}"; then + die "Active version of CPython 2 is not supported by ${CATEGORY}/$= {PF}" + fi else python2_version=3D"" fi @@ -788,21 +777,17 @@ =20 python3_version=3D"$("${EPREFIX}/usr/bin/python3" -c 'from sys impor= t version_info; print(".".join(str(x) for x in version_info[:2]))')" =20 + support_python_major_version=3D"0" for PYTHON_ABI in "${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]}"; do - support_python_major_version=3D"1" - while read restricted_ABI; do - if _python_check_python_abi_matching "${PYTHON_ABI}" "${restricted= _ABI}"; then - support_python_major_version=3D"0" - fi - done <<< "${restricted_ABIs}" - [[ "${support_python_major_version}" =3D=3D "1" ]] && break + if ! _python_check_python_abi_matching --patterns-list "${PYTHON_AB= I}" "${RESTRICT_PYTHON_ABIS}"; then + support_python_major_version=3D"1" + break + fi done if [[ "${support_python_major_version}" =3D=3D "1" ]]; then - while read restricted_ABI; do - if _python_check_python_abi_matching "${python3_version}" "${restr= icted_ABI}"; then - die "Active version of CPython 3 is not supported by ${CATEGORY}/= ${PF}" - fi - done <<< "${restricted_ABIs}" + if _python_check_python_abi_matching --patterns-list "${python3_ver= sion}" "${RESTRICT_PYTHON_ABIS}"; then + die "Active version of CPython 3 is not supported by ${CATEGORY}/$= {PF}" + fi else python3_version=3D"" fi