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 1NUMnh-0000ad-IY for garchives@archives.gentoo.org; Mon, 11 Jan 2010 16:07:29 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 760CDE084D; Mon, 11 Jan 2010 16:07:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1AD7CE08EA for ; Mon, 11 Jan 2010 16:07:27 +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 AC12A1B406E for ; Mon, 11 Jan 2010 16:07:26 +0000 (UTC) Received: from arfrever by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1NUMnc-0001QW-Ai for gentoo-commits@lists.gentoo.org; Mon, 11 Jan 2010 16:07:25 +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, 11 Jan 2010 16:07:24 +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: 354bbfbc-a12b-4520-bd1d-40ab0dd10bac X-Archives-Hash: 2ab254d1e48fd35b7fbbb99cb51ff3a0 arfrever 10/01/11 16:07:24 Modified: python.eclass Log: Disable has_version() checks for Python implementations (bug #300579). Improve some messages. Revision Changes Path 1.84 eclass/python.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?rev=3D1.84&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?rev=3D1.84&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?r1=3D1.83&r2=3D1.84 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.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- python.eclass 10 Jan 2010 17:03:08 -0000 1.83 +++ python.eclass 11 Jan 2010 16:07:23 -0000 1.84 @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.83 2010/01/1= 0 17:03:08 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.84 2010/01/1= 1 16:07:23 arfrever Exp $ =20 # @ECLASS: python.eclass # @MAINTAINER: @@ -186,6 +186,14 @@ fi } =20 +_python_implementation() { + if [[ "${CATEGORY}/${PN}" =3D=3D "dev-lang/python" ]]; then + return 0 + else + return 1 + fi +} + # @FUNCTION: python_set_active_version # @USAGE: # @DESCRIPTION: @@ -196,18 +204,18 @@ fi =20 if [[ "$1" =3D~ ^[[:digit:]]+\.[[:digit:]]+$ ]]; then - if ! has_version "dev-lang/python:$1"; then - die "${FUNCNAME}(): 'dev-lang/python:$1' isn't installed" + if ! _python_implementation && ! has_version "dev-lang/python:$1"; the= n + die "${FUNCNAME}(): 'dev-lang/python:$1' is not installed" fi export EPYTHON=3D"$(PYTHON "$1")" elif [[ "$1" =3D=3D "2" ]]; then - if ! has_version "=3Ddev-lang/python-2*"; then - die "${FUNCNAME}(): '=3Ddev-lang/python-2*' isn't installed" + if ! _python_implementation && ! has_version "=3Ddev-lang/python-2*"; = then + die "${FUNCNAME}(): '=3Ddev-lang/python-2*' is not installed" fi export EPYTHON=3D"$(PYTHON -2)" elif [[ "$1" =3D=3D "3" ]]; then - if ! has_version "=3Ddev-lang/python-3*"; then - die "${FUNCNAME}(): '=3Ddev-lang/python-3*' isn't installed" + if ! _python_implementation && ! has_version "=3Ddev-lang/python-3*"; = then + die "${FUNCNAME}(): '=3Ddev-lang/python-3*' is not installed" fi export EPYTHON=3D"$(PYTHON -3)" else @@ -215,7 +223,7 @@ fi =20 # PYTHON_ABI variable is intended to be used only in ebuilds/eclasses, - # so it doesn't need to be exported to subprocesses. + # so it does not need to be exported to subprocesses. PYTHON_ABI=3D"${EPYTHON#python}" PYTHON_ABI=3D"${PYTHON_ABI%%-*}" } @@ -281,14 +289,14 @@ done =20 if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then - die "USE_PYTHON variable doesn't enable any version of Python suppor= ted by ${CATEGORY}/${PF}" + die "USE_PYTHON variable does not enable any version of Python suppo= rted by ${CATEGORY}/${PF}" fi =20 if [[ "${python2_enabled}" =3D=3D "0" ]]; then - ewarn "USE_PYTHON variable doesn't enable any version of Python 2. T= his configuration is unsupported." + ewarn "USE_PYTHON variable does not enable any version of Python 2. = This configuration is unsupported." fi if [[ "${python3_enabled}" =3D=3D "0" ]]; then - ewarn "USE_PYTHON variable doesn't enable any version of Python 3. T= his configuration is unsupported." + ewarn "USE_PYTHON variable does not enable any version of Python 3. = This configuration is unsupported." fi else local python_version python2_version=3D python3_version=3D support_py= thon_major_version @@ -297,7 +305,7 @@ =20 if has_version "=3Ddev-lang/python-2*"; then if [[ "$(readlink /usr/bin/python2)" !=3D "python2."* ]]; then - die "'/usr/bin/python2' isn't valid symlink" + die "'/usr/bin/python2' is not valid symlink" fi =20 python2_version=3D"$(/usr/bin/python2 -c 'from sys import version_in= fo; print(".".join([str(x) for x in version_info[:2]]))')" @@ -314,7 +322,7 @@ if [[ "${support_python_major_version}" =3D=3D "1" ]]; then for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do if [[ "${python2_version}" =3D=3D ${restricted_ABI} ]]; then - die "Active version of Python 2 isn't supported by ${CATEGORY}/${= PF}" + die "Active version of Python 2 is not supported by ${CATEGORY}/$= {PF}" fi done else @@ -324,7 +332,7 @@ =20 if has_version "=3Ddev-lang/python-3*"; then if [[ "$(readlink /usr/bin/python3)" !=3D "python3."* ]]; then - die "'/usr/bin/python3' isn't valid symlink" + die "'/usr/bin/python3' is not valid symlink" fi =20 python3_version=3D"$(/usr/bin/python3 -c 'from sys import version_in= fo; print(".".join([str(x) for x in version_info[:2]]))')" @@ -341,7 +349,7 @@ if [[ "${support_python_major_version}" =3D=3D "1" ]]; then for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do if [[ "${python3_version}" =3D=3D ${restricted_ABI} ]]; then - die "Active version of Python 3 isn't supported by ${CATEGORY}/${= PF}" + die "Active version of Python 3 is not supported by ${CATEGORY}/$= {PF}" fi done else @@ -366,12 +374,12 @@ fi fi =20 - if [[ "$(declare -p PYTHON_ABIS_SANITY_CHECKS 2> /dev/null)" !=3D "decl= are -- PYTHON_ABIS_SANITY_CHECKS=3D"* ]]; then + if ! _python_implementation && [[ "$(declare -p PYTHON_ABIS_SANITY_CHEC= KS 2> /dev/null)" !=3D "declare -- PYTHON_ABIS_SANITY_CHECKS=3D"* ]]; the= n local PYTHON_ABI for PYTHON_ABI in ${PYTHON_ABIS}; do # Ensure that appropriate version of Python is installed. if ! has_version "dev-lang/python:${PYTHON_ABI}"; then - die "dev-lang/python:${PYTHON_ABI} isn't installed" + die "dev-lang/python:${PYTHON_ABI} is not installed" fi =20 # Ensure that EPYTHON variable is respected. @@ -382,7 +390,7 @@ eerror "EPYTHON: '$(PYTHON)'" eerror "PYTHON_ABI: '${PYTHON_ABI}'" eerror "Version of enabled Python: '$(EPYTHON=3D"$(PYTHON)" python -= c 'from sys import version_info; print(".".join([str(x) for x in version_= info[:2]]))')'" - die "'python' doesn't respect EPYTHON variable" + die "'python' does not respect EPYTHON variable" fi done PYTHON_ABIS_SANITY_CHECKS=3D"1" @@ -445,7 +453,7 @@ [[ -z "${PYTHON_ABI}" ]] && die "PYTHON_ABI variable not set" [[ -z "${dir}" ]] && dir=3D"build" =20 - # Don't delete preexistent directories. + # Do not delete preexistent directories. rm -f "${dir}" || die "Deletion of '${dir}' failed" ln -s "${dir}-${PYTHON_ABI}" "${dir}" || die "Creation of '${dir}' dire= ctory symlink failed" } @@ -509,7 +517,7 @@ shift =20 if [[ -z "$(type -t "${function}")" ]]; then - die "${FUNCNAME}(): '${function}' function isn't defined" + die "${FUNCNAME}(): '${function}' function is not defined" fi else if [[ "$#" -ne "0" ]]; then @@ -640,7 +648,7 @@ fi fi =20 - # Ensure that directory stack hasn't been decreased. + # Ensure that directory stack has not been decreased. if [[ "$(dirs -p | wc -l)" -lt "${previous_directory_stack_length}" ]]= ; then die "Directory stack decreased illegally" fi @@ -650,7 +658,7 @@ popd > /dev/null || die "popd failed" done =20 - # Ensure that the bottom part of directory stack hasn't been changed. = Restore + # Ensure that the bottom part of directory stack has not been changed.= Restore # previous directory (from before running of the specified function) b= efore # comparison of directory stacks to avoid mismatch of directory stacks= after # potential using of 'cd' to change current directory. Restoration of = previous @@ -714,7 +722,7 @@ =20 for argument in "$@"; do if [[ ! -e "${argument}" ]]; then - die "${FUNCNAME}(): '${argument}' doesn't exist" + die "${FUNCNAME}(): '${argument}' does not exist" elif [[ -f "${argument}" ]]; then files+=3D("${argument}") elif [[ -d "${argument}" ]]; then @@ -725,10 +733,10 @@ files+=3D($(find "${argument}" -type f)) fi else - die "${FUNCNAME}(): '${argument}' isn't a regular file" + die "${FUNCNAME}(): '${argument}' is not a regular file" fi else - die "${FUNCNAME}(): '${argument}' isn't a regular file or a directory= " + die "${FUNCNAME}(): '${argument}' is not a regular file or a director= y" fi done =20 @@ -1010,7 +1018,7 @@ # @FUNCTION: python_disable_pyc # @DESCRIPTION: # Tell Python not to automatically recompile modules to .pyc/.pyo -# even if the timestamps/version stamps don't match. This is done +# even if the timestamps/version stamps do not match. This is done # to protect sandbox. python_disable_pyc() { export PYTHONDONTWRITEBYTECODE=3D"1" @@ -1027,6 +1035,8 @@ # @FUNCTION: python_need_rebuild # @DESCRIPTION: Run without arguments, specifies that the package should= be # rebuilt after a python upgrade. +# Do not use this function in ebuilds of packages supporting installatio= n +# for multiple versions of Python. python_need_rebuild() { export PYTHON_NEED_REBUILD=3D"$(PYTHON -A --ABI)" } @@ -1165,8 +1175,8 @@ ewarn "${FUNCNAME}: Ignoring compile option $1" ;; *) - if [[ "$1" =3D~ ^/usr/lib(32|64)?/python[[:digit:]]+\.[[:digit:]]+ = ]]; then - die "${FUNCNAME} doesn't support absolute paths of directories/fil= es in site-packages directories" + if ! _python_implementation && [[ "$1" =3D~ ^/usr/lib(32|64)?/pytho= n[[:digit:]]+\.[[:digit:]]+ ]]; then + die "${FUNCNAME} does not support absolute paths of directories/fi= les in site-packages directories" elif [[ "$1" =3D~ ^/ ]]; then if [[ -d "${root}/$1" ]]; then other_dirs+=3D("${root}/$1") @@ -1175,7 +1185,7 @@ elif [[ -e "${root}/$1" ]]; then ewarn "'${root}/$1' is not a file or a directory!" else - ewarn "'${root}/$1' doesn't exist!" + ewarn "'${root}/$1' does not exist!" fi else for PYTHON_ABI in ${PYTHON_ABIS-${PYTHON_ABI-$(PYTHON -A --ABI)}};= do @@ -1188,7 +1198,7 @@ elif [[ -e "${root}$(python_get_sitedir)/$1" ]]; then ewarn "'$1' is not a file or a directory!" else - ewarn "'$1' doesn't exist!" + ewarn "'$1' does not exist!" fi done fi @@ -1223,7 +1233,7 @@ unset site_packages_absolute_dirs site_packages_absolute_files done =20 - # Don't use PYTHON_ABI in next calls to python_get_libdir(). + # Do not use PYTHON_ABI in next calls to python_get_libdir(). unset PYTHON_ABI =20 if ((${#other_dirs[@]})) || ((${#other_files[@]})); then @@ -1267,7 +1277,7 @@ elif [[ -e "${myroot}/$1" ]]; then ewarn "${myroot}/$1 is not a file or directory!" else - ewarn "${myroot}/$1 doesn't exist!" + ewarn "${myroot}/$1 does not exist!" fi ;; esac @@ -1314,8 +1324,8 @@ if (($#)); then if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then while (($#)); do - if [[ "$1" =3D~ ^/usr/lib(32|64)?/python[[:digit:]]+\.[[:digit:]]+ ]= ]; then - die "${FUNCNAME} doesn't support absolute paths of directories/file= s in site-packages directories" + if ! _python_implementation && [[ "$1" =3D~ ^/usr/lib(32|64)?/python= [[:digit:]]+\.[[:digit:]]+ ]]; then + die "${FUNCNAME} does not support absolute paths of directories/fil= es in site-packages directories" elif [[ "$1" =3D~ ^/ ]]; then SEARCH_PATH+=3D("${root}/${1#/}") else