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 1NlhhD-0008Ao-5N for garchives@archives.gentoo.org; Sun, 28 Feb 2010 11:52:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26C39E077C; Sun, 28 Feb 2010 11:52:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B81BCE077C for ; Sun, 28 Feb 2010 11:52:23 +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 4A33B1B4322 for ; Sun, 28 Feb 2010 11:52:23 +0000 (UTC) Received: from arfrever by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1Nlhh8-0007f0-Ok for gentoo-commits@lists.gentoo.org; Sun, 28 Feb 2010 11:52:22 +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: distutils.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: distutils.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: Sun, 28 Feb 2010 11:52:22 +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: 3b9c764a-4ee4-45b9-97f0-32a2ccb67a44 X-Archives-Hash: bf86970dc550db31cfe8f702d2100fd3 arfrever 10/02/28 11:52:22 Modified: distutils.eclass Log: Do not export distutils_src_unpack() in EAPI >=3D2 and disallow using o= f distutils_src_unpack() in EAPI >=3D2. Improve output of distutils_src_compile(), distutils_src_test() and dis= tutils_src_install(). Check for Jython-related directories in distutils_pkg_postinst() and di= stutils_pkg_postrm(). Revision Changes Path 1.73 eclass/distutils.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.e= class?rev=3D1.73&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.e= class?rev=3D1.73&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.e= class?r1=3D1.72&r2=3D1.73 Index: distutils.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/distutils.eclass,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- distutils.eclass 8 Feb 2010 09:35:38 -0000 1.72 +++ distutils.eclass 28 Feb 2010 11:52:22 -0000 1.73 @@ -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/distutils.eclass,v 1.72 2010/0= 2/08 09:35:38 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.73 2010/0= 2/28 11:52:22 arfrever Exp $ =20 # @ECLASS: distutils.eclass # @MAINTAINER: @@ -9,7 +9,7 @@ # Original author: Jon Nelson # @BLURB: Eclass for packages with build systems using Distutils # @DESCRIPTION: -# The distutils eclass defines phase functions for packages with build s= ystems using Distutils +# The distutils eclass defines phase functions for packages with build s= ystems using Distutils. =20 inherit multilib python =20 @@ -18,19 +18,19 @@ EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_p= ostrm ;; *) - EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_po= stinst pkg_postrm + EXPORT_FUNCTIONS src_prepare src_compile src_install pkg_postinst pkg_= postrm ;; esac =20 if [[ -z "${PYTHON_DEPEND}" ]]; then - DEPEND=3D"virtual/python" + DEPEND=3D"dev-lang/python" RDEPEND=3D"${DEPEND}" fi =20 -if has "${EAPI:-0}" 0 1 2; then +if has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then python=3D"python" else - # Use "$(PYTHON)" or "$(PYTHON -A)" instead of "${python}". + # Use "$(PYTHON)" instead of "${python}". python=3D"die" fi =20 @@ -83,6 +83,11 @@ # Set this to disable renaming of Python scripts containing versioned sh= ebangs # and generation of wrapper scripts. =20 +# @ECLASS-VARIABLE: DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS +# @DESCRIPTION: +# List of paths to Python scripts, relative to ${D}, which are excluded = from +# renaming and generation of wrapper scripts. + # @ECLASS-VARIABLE: DOCS # @DESCRIPTION: # Additional documentation files installed by distutils_src_install(). @@ -116,6 +121,10 @@ # @DESCRIPTION: # The distutils src_unpack function. This function is exported. distutils_src_unpack() { + if ! has "${EAPI:-0}" 0 1; then + die "${FUNCNAME}() cannot be used in this EAPI" + fi + if [[ "${EBUILD_PHASE}" !=3D "unpack" ]]; then die "${FUNCNAME}() can be used only in src_unpack() phase" fi @@ -123,7 +132,7 @@ unpack ${A} cd "${S}" =20 - has "${EAPI:-0}" 0 1 && distutils_src_prepare + distutils_src_prepare } =20 # @FUNCTION: distutils_src_prepare @@ -165,19 +174,21 @@ die "${FUNCNAME}() can be used only in src_compile() phase" fi =20 + _python_set_color_variables + if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then distutils_building() { _distutils_hook pre =20 - echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "= $(_distutils_get_build_dir)" "$@" + echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" bu= ild -b "$(_distutils_get_build_dir)" "$@"${_NORMAL} "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_di= stutils_get_build_dir)" "$@" || return "$?" =20 _distutils_hook post } python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-= s} distutils_building "$@" else - echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$= @" - "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" ||= die "Building failed" + echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" bui= ld "$@"${_NORMAL} + "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || di= e "Building failed" fi } =20 @@ -185,16 +196,18 @@ # @DESCRIPTION: # The distutils src_test function. This function is exported, when DISTU= TILS_SRC_TEST variable is set. distutils_src_test() { + _python_set_color_variables + if [[ "${DISTUTILS_SRC_TEST}" =3D=3D "setup.py" ]]; then if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then distutils_testing() { - echo PYTHONPATH=3D"$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.p= y "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOUR= CE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test = "$@" + echo ${_BOLD}PYTHONPATH=3D"$(_distutils_get_PYTHONPATH)" "$(PYTHON)"= setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPAR= ATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)= ") test "$@"${_NORMAL} PYTHONPATH=3D"$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${= DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DI= RECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" } python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+= -s} distutils_testing "$@" else - echo PYTHONPATH=3D"$(_distutils_get_PYTHONPATH)" "$(PYTHON -A)" setup= .py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed" - PYTHONPATH=3D"$(_distutils_get_PYTHONPATH)" "$(PYTHON -A)" setup.py "= ${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed" + echo ${_BOLD}PYTHONPATH=3D"$(_distutils_get_PYTHONPATH)" "$(PYTHON)" = setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL} + PYTHONPATH=3D"$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${D= ISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed" fi elif [[ "${DISTUTILS_SRC_TEST}" =3D=3D "nosetests" ]]; then python_execute_nosetests -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS= _USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@" @@ -227,6 +240,8 @@ die "${FUNCNAME}() can be used only in src_install() phase" fi =20 + _python_set_color_variables + if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BAS= H_VERSINFO[0]}" -ge 4 ]]; then declare -A wrapper_scripts=3D() @@ -235,9 +250,12 @@ if [[ -d "${D}usr/bin" ]]; then cd "${D}usr/bin" =20 - local file + local nonversioned_file file for file in *; do - if [[ -f "${file}" && ! "${file}" =3D~ [[:digit:]]+\.[[:digit:]]+$= && "$(head -n1 "${file}")" =3D~ ^'#!'.*python[[:digit:]]+\.[[:digit:]]+ = ]]; then + if [[ -f "${file}" && ! "${file}" =3D~ [[:digit:]]+\.[[:digit:]](-= jython)?+$ && "$(head -n1 "${file}")" =3D~ ^'#!'.*(python|jython-)[[:digi= t:]]+\.[[:digit:]]+ ]]; then + for nonversioned_file in "${DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS= [@]}"; do + [[ "${nonversioned_file}" =3D=3D "/usr/bin/${file}" ]] && contin= ue 2 + done mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}= ' failed" wrapper_scripts+=3D(["${D}usr/bin/${file}"]=3D) fi @@ -249,7 +267,7 @@ distutils_installation() { _distutils_hook pre =20 - echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "$= {DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_dist= utils_get_build_dir)") install --root=3D"${D}" --no-compile "$@" + echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $(= [[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b = "$(_distutils_get_build_dir)") install --root=3D"${D}" --no-compile "$@"$= {_NORMAL} "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DIST= UTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils= _get_build_dir)") install --root=3D"${D}" --no-compile "$@" || return "$?= " =20 if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BA= SH_VERSINFO[0]}" -ge 4 ]]; then @@ -268,8 +286,8 @@ # Mark the package to be rebuilt after a Python upgrade. python_need_rebuild =20 - echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install = --root=3D"${D}" --no-compile "$@" - "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --roo= t=3D"${D}" --no-compile "$@" || die "Installation failed" + echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" ins= tall --root=3D"${D}" --no-compile "$@"${_NORMAL} + "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root=3D= "${D}" --no-compile "$@" || die "Installation failed" fi =20 if [[ -e "${D}usr/local" ]]; then @@ -302,7 +320,7 @@ =20 local pylibdir pymod if [[ -z "${PYTHON_MODNAME}" ]]; then - for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do + for pylibdir in "${ROOT}"usr/$(get_libdir)/python* "${ROOT}"/usr/share= /jython-*/Lib; do if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then PYTHON_MODNAME=3D"${PN}" fi @@ -331,7 +349,7 @@ =20 local pylibdir pymod if [[ -z "${PYTHON_MODNAME}" ]]; then - for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do + for pylibdir in "${ROOT}"usr/$(get_libdir)/python* "${ROOT}"/usr/share= /jython-*/Lib; do if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then PYTHON_MODNAME=3D"${PN}" fi @@ -343,9 +361,9 @@ python_mod_cleanup ${PYTHON_MODNAME} else for pymod in ${PYTHON_MODNAME}; do - for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do + for pylibdir in "${ROOT}"usr/$(get_libdir)/python*; do if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then - python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}" + python_mod_cleanup "${pylibdir#${ROOT%/}}/site-packages/${pymod}" fi done done @@ -359,7 +377,7 @@ # @DESCRIPTION: # Deprecated wrapper function for deprecated python_version(). distutils_python_version() { - if ! has "${EAPI:-0}" 0 1 2; then + if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then eerror "Use PYTHON() and/or python_get_*() instead of ${FUNCNAME}()." die "${FUNCNAME}() cannot be used in this EAPI" fi @@ -369,10 +387,10 @@ =20 # @FUNCTION: distutils_python_tkinter # @DESCRIPTION: -# Deprecated wrapper function for python_tkinter_exists(). +# Deprecated wrapper function for deprecated python_tkinter_exists(). distutils_python_tkinter() { - if ! has "${EAPI:-0}" 0 1 2; then - eerror "Use python_tkinter_exists() instead of ${FUNCNAME}()." + if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_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