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 1Nt2xb-00046B-01 for garchives@archives.gentoo.org; Sat, 20 Mar 2010 17:59:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E5A25E0994; Sat, 20 Mar 2010 17:59:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7A185E0994 for ; Sat, 20 Mar 2010 17:59:41 +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 0583F1B402E for ; Sat, 20 Mar 2010 17:59:41 +0000 (UTC) Received: from arfrever by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1Nt2xY-0002I4-Hm for gentoo-commits@lists.gentoo.org; Sat, 20 Mar 2010 17:59:40 +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: Sat, 20 Mar 2010 17:59:40 +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: 6abe2b3a-4984-4dd0-a218-2cb906fcfc89 X-Archives-Hash: 17e0c3e0009fd5e0726fe4c80799a618 arfrever 10/03/20 17:59:40 Modified: python.eclass Log: Fix handling of PYTHON_USE_WITH_OPT in python_pkg_setup(). Improve error messages in some functions. Delete python_set_build_dir_symlink(). Fix wrapper scripts generated by python_generate_wrapper_scripts(). Improve deprecation warnings in python_version(), python_mod_exists() a= nd python_tkinter_exists(). Revision Changes Path 1.95 eclass/python.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?rev=3D1.95&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?rev=3D1.95&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?r1=3D1.94&r2=3D1.95 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.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- python.eclass 13 Mar 2010 13:46:20 -0000 1.94 +++ python.eclass 20 Mar 2010 17:59:40 -0000 1.95 @@ -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.94 2010/03/1= 3 13:46:20 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.95 2010/03/2= 0 17:59:40 arfrever Exp $ =20 # @ECLASS: python.eclass # @MAINTAINER: @@ -198,7 +198,13 @@ die "${1}" } =20 - [[ ${PYTHON_USE_WITH_OPT} ]] && use !${PYTHON_USE_WITH_OPT} && return + if [[ "${PYTHON_USE_WITH_OPT}" ]]; then + if [[ "${PYTHON_USE_WITH_OPT}" =3D=3D !* ]]; then + use ${PYTHON_USE_WITH_OPT#!} && return + else + use !${PYTHON_USE_WITH_OPT} && return + fi + fi =20 python_pkg_setup_check_USE_flags() { local pyatom use @@ -221,7 +227,7 @@ fi } =20 - if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if _python_package_supporting_installation_for_multiple_python_abis; t= hen python_execute_function -q python_pkg_setup_check_USE_flags else python_pkg_setup_check_USE_flags @@ -261,13 +267,13 @@ unset _PYTHON_ATOMS =20 # =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=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 FUNCTIONS FOR PACKAGES SUPPORTING INSTALLATIO= N FOR MULTIPLE VERSIONS OF PYTHON =3D=3D=3D=3D=3D=3D=3D=3D +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D FUNCTIONS FOR PACKAGES SUPPORTING IN= STALLATION FOR MULTIPLE PYTHON ABIS =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=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 =20 # @ECLASS-VARIABLE: SUPPORT_PYTHON_ABIS # @DESCRIPTION: # Set this in EAPI <=3D 4 to indicate that current package supports inst= allation for -# multiple versions of Python. +# multiple Python ABIs. =20 # @ECLASS-VARIABLE: PYTHON_EXPORT_PHASE_FUNCTIONS # @DESCRIPTION: @@ -275,11 +281,19 @@ # src_prepare, src_configure, src_compile, src_test, src_install. if ! has "${EAPI:-0}" 0 1; then python_src_prepare() { + if ! _python_package_supporting_installation_for_multiple_python_abis;= then + die "${FUNCNAME}() cannot be used in ebuilds of packages not supporti= ng installation for multiple Python ABIs" + fi + python_copy_sources } =20 for python_default_function in src_configure src_compile src_test src_i= nstall; do eval "python_${python_default_function}() { + if ! _python_package_supporting_installation_for_multiple_python_abis= ; then + die \"\${FUNCNAME}() cannot be used in ebuilds of packages not suppo= rting installation for multiple Python ABIs\" + fi + python_execute_function -d -s \"\$@\" }" done @@ -297,9 +311,8 @@ # Ensure that PYTHON_ABIS variable has valid value. # This function usually should not be directly called in ebuilds. validate_PYTHON_ABIS() { - # Ensure that some functions cannot be accidentally successfully used i= n EAPI <=3D 4 without setting SUPPORT_PYTHON_ABIS variable. - if has "${EAPI:-0}" 0 1 2 3 4 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; the= n - die "${FUNCNAME}() cannot be used in this EAPI without setting SUPPORT= _PYTHON_ABIS variable" + if ! _python_package_supporting_installation_for_multiple_python_abis; = then + die "${FUNCNAME}() cannot be used in ebuilds of packages not supportin= g installation for multiple Python ABIs" fi =20 _python_initial_sanity_checks @@ -336,11 +349,11 @@ done =20 if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then - die "USE_PYTHON variable does not enable any version of Python suppo= rted by ${CATEGORY}/${PF}" + die "USE_PYTHON variable does not enable any Python ABI supported by= ${CATEGORY}/${PF}" fi =20 if [[ "${cpython_enabled}" =3D=3D "0" ]]; then - die "USE_PYTHON variable does not enable any version of CPython" + die "USE_PYTHON variable does not enable any CPython ABI" fi else local python_version python2_version=3D python3_version=3D support_py= thon_major_version @@ -427,6 +440,10 @@ # Execute specified function for each value of PYTHON_ABIS, optionally p= assing additional # arguments. The specified function can use PYTHON_ABI and BUILDDIR vari= ables. python_execute_function() { + if ! _python_package_supporting_installation_for_multiple_python_abis; = then + die "${FUNCNAME}() cannot be used in ebuilds of packages not supportin= g installation for multiple Python ABIs" + fi + _python_set_color_variables =20 local action action_message action_message_template=3D default_function= =3D"0" failure_message failure_message_template=3D final_ABI=3D"0" functi= on i iterated_PYTHON_ABIS nonfatal=3D"0" previous_directory previous_dire= ctory_stack previous_directory_stack_length PYTHON_ABI quiet=3D"0" separa= te_build_dirs=3D"0" source_dir=3D @@ -525,6 +542,7 @@ function=3D"python_default_function" fi =20 + # Ensure that python_execute_function() cannot be directly or indirectl= y called by python_execute_function(). for ((i =3D 1; i < "${#FUNCNAME[@]}"; i++)); do if [[ "${FUNCNAME[${i}]}" =3D=3D "${FUNCNAME}" ]]; then die "${FUNCNAME}(): Invalid call stack" @@ -605,7 +623,7 @@ ewarn "${_RED}${failure_message}${_NORMAL}" fi if [[ -z "${PYTHON_ABIS}" ]]; then - die "${function}() function failed with all enabled versions of Pyt= hon" + die "${function}() function failed with all enabled Python ABIs" fi else die "${failure_message}" @@ -649,6 +667,10 @@ # @DESCRIPTION: # Copy unpacked sources of current package to separate build directory f= or each Python ABI. python_copy_sources() { + if ! _python_package_supporting_installation_for_multiple_python_abis; = then + die "${FUNCNAME}() cannot be used in ebuilds of packages not supportin= g installation for multiple Python ABIs" + fi + local dir dirs=3D() PYTHON_ABI =20 if [[ "$#" -eq 0 ]]; then @@ -668,21 +690,6 @@ done } =20 -# @FUNCTION: python_set_build_dir_symlink -# @USAGE: -# @DESCRIPTION: -# Create build directory symlink. -python_set_build_dir_symlink() { - local dir=3D"$1" - - [[ -z "${PYTHON_ABI}" ]] && die "PYTHON_ABI variable not set" - [[ -z "${dir}" ]] && dir=3D"build" - - # 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" -} - # @FUNCTION: python_generate_wrapper_scripts # @USAGE: [-E|--respect-EPYTHON] [-f|--force] [-q|--quiet] [--] [= files] # @DESCRIPTION: @@ -690,6 +697,10 @@ # If --respect-EPYTHON option is specified, then generated wrapper scrip= ts will # respect EPYTHON variable at run time. python_generate_wrapper_scripts() { + if ! _python_package_supporting_installation_for_multiple_python_abis; = then + die "${FUNCNAME}() cannot be used in ebuilds of packages not supportin= g installation for multiple Python ABIs" + fi + _python_initialize_prefix_variables =20 local eselect_python_option file force=3D"0" quiet=3D"0" PYTHON_ABI pyt= hon2_enabled=3D"0" python3_enabled=3D"0" respect_EPYTHON=3D"0" @@ -790,16 +801,17 @@ sys.stderr.write("Execution of 'eselect python show${eselect_python_op= tion:+ }${eselect_python_option}' failed\n") sys.exit(1) =20 - EPYTHON =3D eselect_process.stdout.read().rstrip("\n") + EPYTHON =3D eselect_process.stdout.read() if not isinstance(EPYTHON, str): # Python 3 EPYTHON =3D EPYTHON.decode() + EPYTHON =3D EPYTHON.rstrip("\n") =20 EPYTHON_matched =3D EPYTHON_re.match(EPYTHON) if EPYTHON_matched: PYTHON_ABI =3D EPYTHON_matched.group(1) else: - sys.stderr.write("'eselect python show${eselect_python_option:+ }${ese= lect_python_option}' printed unrecognized value '%s" % EPYTHON) + sys.stderr.write("'eselect python show${eselect_python_option:+ }${ese= lect_python_option}' printed unrecognized value '%s'\n" % EPYTHON) sys.exit(1) EOF if [[ "$?" !=3D "0" ]]; then @@ -815,16 +827,17 @@ sys.stderr.write("Execution of 'eselect python show${eselect_python_opt= ion:+ }${eselect_python_option}' failed\n") sys.exit(1) =20 -EPYTHON =3D eselect_process.stdout.read().rstrip("\n") +EPYTHON =3D eselect_process.stdout.read() if not isinstance(EPYTHON, str): # Python 3 EPYTHON =3D EPYTHON.decode() +EPYTHON =3D EPYTHON.rstrip("\n") =20 EPYTHON_matched =3D EPYTHON_re.match(EPYTHON) if EPYTHON_matched: PYTHON_ABI =3D EPYTHON_matched.group(1) else: - sys.stderr.write("'eselect python show${eselect_python_option:+ }${esel= ect_python_option}' printed unrecognized value '%s" % EPYTHON) + sys.stderr.write("'eselect python show${eselect_python_option:+ }${esel= ect_python_option}' printed unrecognized value '%s'\n" % EPYTHON) sys.exit(1) EOF if [[ "$?" !=3D "0" ]]; then @@ -883,7 +896,7 @@ } =20 # =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=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 FUNCTIONS FOR PACKAGES NOT SUPPORTING INSTALLATION = FOR MULTIPLE VERSIONS OF PYTHON =3D=3D=3D=3D=3D=3D +# =3D=3D=3D=3D=3D=3D=3D=3D=3D FUNCTIONS FOR PACKAGES NOT SUPPORTING INST= ALLATION FOR MULTIPLE PYTHON ABIS =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=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 =20 # @FUNCTION: python_set_active_version @@ -891,8 +904,8 @@ # @DESCRIPTION: # Set specified version of CPython as active version of Python. python_set_active_version() { - if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then - die "${FUNCNAME}() cannot be used in ebuilds of packages supporting in= stallation for multiple versions of Python" + if _python_package_supporting_installation_for_multiple_python_abis; th= en + die "${FUNCNAME}() cannot be used in ebuilds of packages supporting in= stallation for multiple Python ABIs" fi =20 if [[ "$#" -ne 1 ]]; then @@ -935,8 +948,8 @@ # @DESCRIPTION: Mark current package for rebuilding by python-updater af= ter # switching of active version of Python. python_need_rebuild() { - if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then - die "${FUNCNAME}() cannot be used in ebuilds of packages supporting in= stallation for multiple versions of Python" + if _python_package_supporting_installation_for_multiple_python_abis; th= en + die "${FUNCNAME}() cannot be used in ebuilds of packages supporting in= stallation for multiple Python ABIs" fi =20 export PYTHON_NEED_REBUILD=3D"$(PYTHON --ABI)" @@ -1023,8 +1036,8 @@ =20 if [[ "$#" -eq 0 ]]; then if [[ "${final_ABI}" =3D=3D "1" ]]; then - if has "${EAPI:-0}" 0 1 2 3 4 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; t= hen - die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds o= f packages not supporting installation for multiple versions of Python" + if ! _python_package_supporting_installation_for_multiple_python_abis= ; then + die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds o= f packages not supporting installation for multiple Python ABIs" fi validate_PYTHON_ABIS PYTHON_ABI=3D"${PYTHON_ABIS##* }" @@ -1042,7 +1055,7 @@ elif [[ "${PYTHON_ABI}" !=3D "3."* ]]; then die "${FUNCNAME}(): Internal error in \`eselect python show --python= 3\`" fi - elif [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then + elif ! _python_package_supporting_installation_for_multiple_python_abi= s; then PYTHON_ABI=3D"$("${EPREFIX}/usr/bin/python" -c "${_PYTHON_ABI_EXTRACT= ION_COMMAND}")" elif [[ -z "${PYTHON_ABI}" ]]; then die "${FUNCNAME}(): Invalid usage: ${FUNCNAME}() should be used in AB= I-specific local scope" @@ -1108,6 +1121,9 @@ done =20 if [[ "${final_ABI}" =3D=3D "1" ]]; then + if ! _python_package_supporting_installation_for_multiple_python_abis;= then + die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds of= packages not supporting installation for multiple Python ABIs" + fi PYTHON_ABI=3D"$(PYTHON -f --ABI)" elif [[ -z "${PYTHON_ABI}" ]]; then PYTHON_ABI=3D"$(PYTHON --ABI)" @@ -1140,6 +1156,9 @@ done =20 if [[ "${final_ABI}" =3D=3D "1" ]]; then + if ! _python_package_supporting_installation_for_multiple_python_abis;= then + die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds of= packages not supporting installation for multiple Python ABIs" + fi PYTHON_ABI=3D"$(PYTHON -f --ABI)" elif [[ -z "${PYTHON_ABI}" ]]; then PYTHON_ABI=3D"$(PYTHON --ABI)" @@ -1176,6 +1195,9 @@ done =20 if [[ "${final_ABI}" =3D=3D "1" ]]; then + if ! _python_package_supporting_installation_for_multiple_python_abis;= then + die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds of= packages not supporting installation for multiple Python ABIs" + fi PYTHON_ABI=3D"$(PYTHON -f --ABI)" elif [[ -z "${PYTHON_ABI}" ]]; then PYTHON_ABI=3D"$(PYTHON --ABI)" @@ -1212,6 +1234,9 @@ done =20 if [[ "${final_ABI}" =3D=3D "1" ]]; then + if ! _python_package_supporting_installation_for_multiple_python_abis;= then + die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds of= packages not supporting installation for multiple Python ABIs" + fi PYTHON_ABI=3D"$(PYTHON -f --ABI)" elif [[ -z "${PYTHON_ABI}" ]]; then PYTHON_ABI=3D"$(PYTHON --ABI)" @@ -1235,6 +1260,9 @@ while (($#)); do case "$1" in -f|--final-ABI) + if ! _python_package_supporting_installation_for_multiple_python_abi= s; then + die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds = of packages not supporting installation for multiple Python ABIs" + fi options+=3D("$1") ;; -*) @@ -1278,6 +1306,9 @@ done =20 if [[ "${final_ABI}" =3D=3D "1" ]]; then + if ! _python_package_supporting_installation_for_multiple_python_abis;= then + die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds of= packages not supporting installation for multiple Python ABIs" + fi PYTHON_ABI=3D"$(PYTHON -f --ABI)" elif [[ -z "${PYTHON_ABI}" ]]; then PYTHON_ABI=3D"$(PYTHON --ABI)" @@ -1356,6 +1387,9 @@ fi =20 if [[ "${final_ABI}" =3D=3D "1" ]]; then + if ! _python_package_supporting_installation_for_multiple_python_abis;= then + die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds of= packages not supporting installation for multiple Python ABIs" + fi "$(PYTHON -f)" -c "${python_command}" else "$(PYTHON ${PYTHON_ABI})" -c "${python_command}" @@ -1376,6 +1410,22 @@ fi } =20 +_python_package_supporting_installation_for_multiple_python_abis() { + if [[ "${EBUILD_PHASE}" =3D=3D "depend" ]]; then + die "${FUNCNAME}() cannot be used in global scope" + fi + + if has "${EAPI:-0}" 0 1 2 3 4; then + if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + return 0 + else + return 1 + fi + else + die "${FUNCNAME}(): Support for EAPI=3D\"${EAPI}\" not implemented" + fi +} + _python_initialize_prefix_variables() { if has "${EAPI:-0}" 0 1 2; then if [[ -n "${ROOT}" && -z "${EROOT}" ]]; then @@ -1495,11 +1545,9 @@ files+=3D("${argument}") elif [[ -d "${argument}" ]]; then if [[ "${recursive}" =3D=3D "1" ]]; then - if [[ "${only_executables}" =3D=3D "1" ]]; then - files+=3D($(find "${argument}" -perm /111 -type f)) - else - files+=3D($(find "${argument}" -type f)) - fi + while read -d $'\0' -r file; do + files+=3D("${file}") + done < <(find "${argument}" $([[ "${only_executables}" =3D=3D "1" ]]= && echo -perm /111) -type f -print0) else die "${FUNCNAME}(): '${argument}' is not a regular file" fi @@ -1551,7 +1599,7 @@ die "${FUNCNAME}() requires 1 argument" fi =20 - if [[ -n "${SUPPORT_PYTHON_ABIS}" && "$(type -t "${FUNCNAME[3]}_$1_hook= ")" =3D=3D "function" ]]; then + if _python_package_supporting_installation_for_multiple_python_abis && = [[ "$(type -t "${FUNCNAME[3]}_$1_hook")" =3D=3D "function" ]]; then "${FUNCNAME[3]}_$1_hook" fi } @@ -1559,9 +1607,9 @@ # @FUNCTION: python_execute_nosetests # @USAGE: [-P|--PYTHONPATH PYTHONPATH] [-s|--separate-build-dirs] [--] [= arguments] # @DESCRIPTION: -# Execute nosetests for all enabled versions of Python. -# In ebuilds of packages supporting installation for multiple versions o= f Python, this function -# calls python_execute_nosetests_pre_hook() and python_execute_nosetests= _post_hook(), if they are defined. +# Execute nosetests for all enabled Python ABIs. +# In ebuilds of packages supporting installation for multiple Python ABI= s, this function calls +# python_execute_nosetests_pre_hook() and python_execute_nosetests_post_= hook(), if they are defined. python_execute_nosetests() { _python_set_color_variables =20 @@ -1612,7 +1660,7 @@ =20 _python_test_hook post } - if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if _python_package_supporting_installation_for_multiple_python_abis; th= en python_execute_function ${separate_build_dirs:+-s} python_test_functio= n "$@" else if [[ -n "${separate_build_dirs}" ]]; then @@ -1627,9 +1675,9 @@ # @FUNCTION: python_execute_py.test # @USAGE: [-P|--PYTHONPATH PYTHONPATH] [-s|--separate-build-dirs] [--] [= arguments] # @DESCRIPTION: -# Execute py.test for all enabled versions of Python. -# In ebuilds of packages supporting installation for multiple versions o= f Python, this function -# calls python_execute_py.test_pre_hook() and python_execute_py.test_pos= t_hook(), if they are defined. +# Execute py.test for all enabled Python ABIs. +# In ebuilds of packages supporting installation for multiple Python ABI= s, this function calls +# python_execute_py.test_pre_hook() and python_execute_py.test_post_hook= (), if they are defined. python_execute_py.test() { _python_set_color_variables =20 @@ -1680,7 +1728,7 @@ =20 _python_test_hook post } - if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if _python_package_supporting_installation_for_multiple_python_abis; th= en python_execute_function ${separate_build_dirs:+-s} python_test_functio= n "$@" else if [[ -n "${separate_build_dirs}" ]]; then @@ -1695,8 +1743,8 @@ # @FUNCTION: python_execute_trial # @USAGE: [-P|--PYTHONPATH PYTHONPATH] [-s|--separate-build-dirs] [--] [= arguments] # @DESCRIPTION: -# Execute trial for all enabled versions of Python. -# In ebuilds of packages supporting installation for multiple versions o= f Python, this function +# Execute trial for all enabled Python ABIs. +# In ebuilds of packages supporting installation for multiple Python ABI= s, this function # calls python_execute_trial_pre_hook() and python_execute_trial_post_ho= ok(), if they are defined. python_execute_trial() { _python_set_color_variables @@ -1748,7 +1796,7 @@ =20 _python_test_hook post } - if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if _python_package_supporting_installation_for_multiple_python_abis; th= en python_execute_function ${separate_build_dirs:+-s} python_test_functio= n "$@" else if [[ -n "${separate_build_dirs}" ]]; then @@ -1797,9 +1845,9 @@ _python_initialize_prefix_variables =20 # Check if phase is pkg_postinst(). - [[ ${EBUILD_PHASE} !=3D "postinst" ]] && die "${FUNCNAME}() can be used= only in pkg_postinst() phase" + [[ "${EBUILD_PHASE}" !=3D "postinst" ]] && die "${FUNCNAME}() can be us= ed only in pkg_postinst() phase" =20 - if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation_= for_multiple_python_abis; then local dir file options=3D() other_dirs=3D() other_files=3D() previous_= PYTHON_ABI=3D"${PYTHON_ABI}" PYTHON_ABI=3D"${PYTHON_ABI}" return_code roo= t site_packages_absolute_dirs=3D() site_packages_dirs=3D() site_packages_= absolute_files=3D() site_packages_files=3D() =20 # Strip trailing slash from ROOT. @@ -1975,13 +2023,13 @@ local path py_file PYTHON_ABI=3D"${PYTHON_ABI}" SEARCH_PATH=3D() root =20 # Check if phase is pkg_postrm(). - [[ ${EBUILD_PHASE} !=3D "postrm" ]] && die "${FUNCNAME}() can be used o= nly in pkg_postrm() phase" + [[ "${EBUILD_PHASE}" !=3D "postrm" ]] && die "${FUNCNAME}() can be used= only in pkg_postrm() phase" =20 # Strip trailing slash from ROOT. root=3D"${EROOT%/}" =20 if (($#)); then - if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation= _for_multiple_python_abis; then while (($#)); do if ! _python_implementation && [[ "$1" =3D~ ^"${EPREFIX}"/usr/lib(32= |64)?/python[[:digit:]]+\.[[:digit:]]+ ]]; then die "${FUNCNAME}() does not support absolute paths of directories/f= iles in site-packages directories" @@ -2058,17 +2106,25 @@ # Run without arguments and it will export the version of python # currently in use as $PYVER; sets PYVER/PYVER_MAJOR/PYVER_MINOR python_version() { - if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation_= for_multiple_python_abis; then eerror "Use PYTHON() and/or python_get_*() instead of ${FUNCNAME}()." die "${FUNCNAME}() cannot be used in this EAPI" fi =20 + _python_set_color_variables + if [[ "${FUNCNAME[1]}" !=3D "distutils_python_version" ]]; then - einfo - einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be ba= nned on 2010-07-01." - einfo "Use PYTHON() instead of python variable. Use python_get_*() ins= tead of PYVER* variables." - einfo "The ebuild needs to be fixed. Please report a bug, if it has no= t been already reported." - einfo + echo + echo " ${_RED}*${_NORMAL} ${_RED}Deprecation Warning: ${FUNCNAME}() is= deprecated and will be banned on 2010-07-01.${_NORMAL}" + echo " ${_RED}*${_NORMAL} ${_RED}Use PYTHON() instead of python variab= le. Use python_get_*() instead of PYVER* variables.${_NORMAL}" + echo " ${_RED}*${_NORMAL} ${_RED}The ebuild needs to be fixed. Please = report a bug, if it has not been already reported.${_NORMAL}" + echo + + einfo &> /dev/null + einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be ba= nned on 2010-07-01." &> /dev/null + einfo "Use PYTHON() instead of python variable. Use python_get_*() ins= tead of PYVER* variables." &> /dev/null + einfo "The ebuild needs to be fixed. Please report a bug, if it has no= t been already reported." &> /dev/null + einfo &> /dev/null fi =20 [[ -n "${PYVER}" ]] && return 0 @@ -2097,16 +2153,22 @@ # echo "gtk support enabled" # fi python_mod_exists() { - if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation_= for_multiple_python_abis; then eerror "Use USE dependencies and/or has_version() instead of ${FUNCNAM= E}()." die "${FUNCNAME}() cannot be used in this EAPI" fi =20 - einfo - einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be ban= ned on 2010-07-01." - einfo "Use USE dependencies and/or has_version() instead of ${FUNCNAME}= ()." - einfo "The ebuild needs to be fixed. Please report a bug, if it has not= been already reported." - einfo + echo + echo " ${_RED}*${_NORMAL} ${_RED}Deprecation Warning: ${FUNCNAME}() is = deprecated and will be banned on 2010-07-01.${_NORMAL}" + echo " ${_RED}*${_NORMAL} ${_RED}Use USE dependencies and/or has_versio= n() instead of ${FUNCNAME}().${_NORMAL}" + echo " ${_RED}*${_NORMAL} ${_RED}The ebuild needs to be fixed. Please r= eport a bug, if it has not been already reported.${_NORMAL}" + echo + + einfo &> /dev/null + einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be ban= ned on 2010-07-01." &> /dev/null + einfo "Use USE dependencies and/or has_version() instead of ${FUNCNAME}= ()." &> /dev/null + einfo "The ebuild needs to be fixed. Please report a bug, if it has not= been already reported." &> /dev/null + einfo &> /dev/null =20 if [[ "$#" -ne 1 ]]; then die "${FUNCNAME}() requires 1 argument" @@ -2119,17 +2181,23 @@ # Run without arguments, checks if Python was compiled with Tkinter # support. If not, prints an error message and dies. python_tkinter_exists() { - if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation_= for_multiple_python_abis; then eerror "Use PYTHON_USE_WITH=3D\"xml\" and python_pkg_setup() instead o= f ${FUNCNAME}()." die "${FUNCNAME}() cannot be used in this EAPI" fi =20 if [[ "${FUNCNAME[1]}" !=3D "distutils_python_tkinter" ]]; then - einfo - einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be ba= nned on 2010-07-01." - einfo "Use PYTHON_USE_WITH=3D\"xml\" and python_pkg_setup() instead of= ${FUNCNAME}()." - einfo "The ebuild needs to be fixed. Please report a bug, if it has no= t been already reported." - einfo + echo + echo " ${_RED}*${_NORMAL} ${_RED}Deprecation Warning: ${FUNCNAME}() is= deprecated and will be banned on 2010-07-01.${_NORMAL}" + echo " ${_RED}*${_NORMAL} ${_RED}Use PYTHON_USE_WITH=3D\"xml\" and pyt= hon_pkg_setup() instead of ${FUNCNAME}().${_NORMAL}" + echo " ${_RED}*${_NORMAL} ${_RED}The ebuild needs to be fixed. Please = report a bug, if it has not been already reported.${_NORMAL}" + echo + + einfo &> /dev/null + einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be ba= nned on 2010-07-01." &> /dev/null + einfo "Use PYTHON_USE_WITH=3D\"xml\" and python_pkg_setup() instead of= ${FUNCNAME}()." &> /dev/null + einfo "The ebuild needs to be fixed. Please report a bug, if it has no= t been already reported." &> /dev/null + einfo &> /dev/null fi =20 if ! "$(PYTHON ${PYTHON_ABI})" -c "from sys import version_info @@ -2154,7 +2222,7 @@ # python_mod_compile /usr/lib/python2.3/site-packages/pygoogle.p= y # python_mod_compile() { - if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then + if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation_= for_multiple_python_abis; then eerror "Use python_mod_optimize() instead of ${FUNCNAME}()." die "${FUNCNAME}() cannot be used in this EAPI" fi @@ -2164,7 +2232,7 @@ local f myroot myfiles=3D() =20 # Check if phase is pkg_postinst() - [[ ${EBUILD_PHASE} !=3D postinst ]] && die "${FUNCNAME}() can be used o= nly in pkg_postinst() phase" + [[ "${EBUILD_PHASE}" !=3D "postinst" ]] && die "${FUNCNAME}() can be us= ed only in pkg_postinst() phase" =20 # strip trailing slash myroot=3D"${EROOT%/}"