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 1Mhpbv-00053D-3j for garchives@archives.gentoo.org; Sun, 30 Aug 2009 18:58:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 95432E08CE; Mon, 31 Aug 2009 00:07:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5C862E08CE for ; Mon, 31 Aug 2009 00:07:39 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 3CC1E66737 for ; Mon, 31 Aug 2009 00:07:48 +0000 (UTC) Received: from arfrever by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1MhuQs-0007f1-Eq for gentoo-commits@lists.gentoo.org; Mon, 31 Aug 2009 00:07:38 +0000 From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, arfrever@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: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis Content-Type: text/plain; charset=utf8 Message-Id: Sender: Arfrever Frehtes Taifersar Arahesis Date: Mon, 31 Aug 2009 00:07:38 +0000 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: 39983bdf-cfd4-4b7f-8d42-ee86d722a9b8 X-Archives-Hash: 710ed9ac2977acff5696ae0c01ffa351 arfrever 09/08/31 00:07:38 Modified: python.eclass Log: Improve validate_PYTHON_ABIS(). Revision Changes Path 1.68 eclass/python.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?rev=3D1.68&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?rev=3D1.68&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?r1=3D1.67&r2=3D1.68 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.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- python.eclass 29 Aug 2009 02:15:24 -0000 1.67 +++ python.eclass 31 Aug 2009 00:07:37 -0000 1.68 @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.67 2009/08/2= 9 02:15:24 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.68 2009/08/3= 1 00:07:37 arfrever Exp $ =20 # @ECLASS: python.eclass # @MAINTAINER: @@ -130,28 +130,41 @@ if [[ -z "${PYTHON_ABIS}" ]] && has "${EAPI:-0}" 0 1 2 3; then local ABI support_ABI supported_PYTHON_ABIS=3D restricted_ABI PYTHON_ABI_SUPPORTED_VALUES=3D"2.4 2.5 2.6 2.7 3.0 3.1 3.2" - for ABI in ${USE_PYTHON}; do - if ! has "${ABI}" ${PYTHON_ABI_SUPPORTED_VALUES}; then - ewarn "Ignoring unsupported Python ABI '${ABI}'" - continue + + if declare -p | grep "^declare -x USE_PYTHON=3D" > /dev/null; then + if [[ -z "${USE_PYTHON}" ]]; then + die "USE_PYTHON variable is empty" fi - support_ABI=3D"1" - if [[ -z "${IGNORE_RESTRICT_PYTHON_ABIS}" ]]; then + + for ABI in ${USE_PYTHON}; do + if ! has "${ABI}" ${PYTHON_ABI_SUPPORTED_VALUES}; then + die "USE_PYTHON variable contains invalid value '${ABI}'" + fi + support_ABI=3D"1" for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do if python -c "from fnmatch import fnmatch; exit(not fnmatch('${ABI}= ', '${restricted_ABI}'))"; then support_ABI=3D"0" break fi done + [[ "${support_ABI}" =3D=3D "1" ]] && supported_PYTHON_ABIS+=3D" ${AB= I}" + done + export PYTHON_ABIS=3D"${supported_PYTHON_ABIS# }" + + if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then + die "USE_PYTHON variable doesn't enable any Python version supported= by ${CATEGORY}/${PF}" fi - [[ "${support_ABI}" =3D=3D "1" ]] && supported_PYTHON_ABIS+=3D" ${ABI= }" - done - export PYTHON_ABIS=3D"${supported_PYTHON_ABIS# }" - fi + else + local restricted_ABI + python_version =20 - if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then - python_version - export PYTHON_ABIS=3D"${PYVER}" + for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do + if python -c "from fnmatch import fnmatch; exit(not fnmatch('${PYVER= }', '${restricted_ABI}'))"; then + die "Active Python version isn't supported by ${CATEGORY}/${PF}" + fi + done + export PYTHON_ABIS=3D"${PYVER}" + fi fi =20 # Ensure that EPYTHON variable is respected.