public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" <arfrever@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
Date: Tue, 12 Apr 2011 18:49:03 +0000 (UTC)	[thread overview]
Message-ID: <20110412184903.352C620054@flycatcher.gentoo.org> (raw)

arfrever    11/04/12 18:49:03

  Modified:             distutils.eclass
  Log:
  Unconditionally print deprecation warnings for usage of distutils.eclass in old EAPIs.
  Support specifying current working directory in DISTUTILS_SETUP_FILES.
  Support specifying Python ABI pattern in DISTUTILS_GLOBAL_OPTIONS in EAPI >=4.
  Ban DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS.
  Add sanity checks in some functions.
  Disable installation of useless files in distutils_src_install().
  Handle *-nspkg.pth files in distutils_src_install().
  Support EAPI="4" in handling of DOCS in distutils_src_install.
  Delete distutils_python_version() and distutils_python_tkinter().
  Add distutils_get_intermediate_installation_image().

Revision  Changes    Path
1.80                 eclass/distutils.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.80&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.80&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?r1=1.79&r2=1.80

Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- distutils.eclass	24 Dec 2010 15:05:24 -0000	1.79
+++ distutils.eclass	12 Apr 2011 18:49:03 -0000	1.80
@@ -1,12 +1,10 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.79 2010/12/24 15:05:24 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.80 2011/04/12 18:49:03 arfrever Exp $
 
 # @ECLASS: distutils.eclass
 # @MAINTAINER:
 # Gentoo Python Project <python@gentoo.org>
-#
-# Original author: Jon Nelson <jnelson@gentoo.org>
 # @BLURB: Eclass for packages with build systems using Distutils
 # @DESCRIPTION:
 # The distutils eclass defines phase functions for packages with build systems using Distutils.
@@ -27,7 +25,6 @@
 	RDEPEND="${DEPEND}"
 fi
 
-if [[ -n "${PYTHON_DEPRECATION_WARNINGS}" ]]; then
 	if has "${EAPI:-0}" 0 1 && [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
 		ewarn
 		ewarn "\"${EBUILD}\":"
@@ -43,7 +40,6 @@
 		ewarn "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
 		ewarn
 	fi
-fi
 
 # 'python' variable is deprecated. Use PYTHON() instead.
 if has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
@@ -58,11 +54,17 @@
 
 # @ECLASS-VARIABLE: DISTUTILS_SETUP_FILES
 # @DESCRIPTION:
-# Paths to setup files.
+# Array of paths to setup files.
+# Syntax:
+#   [current_working_directory|]path_to_setup_file
 
 # @ECLASS-VARIABLE: DISTUTILS_GLOBAL_OPTIONS
 # @DESCRIPTION:
-# Global options passed to setup files.
+# Array of global options passed to setup files.
+# Syntax in EAPI <4:
+#   global_option
+# Syntax in EAPI >=4:
+#   Python_ABI_pattern global_option
 
 # @ECLASS-VARIABLE: DISTUTILS_SRC_TEST
 # @DESCRIPTION:
@@ -100,19 +102,10 @@
 	EXPORT_FUNCTIONS src_test
 fi
 
-# @ECLASS-VARIABLE: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS
-# @DESCRIPTION:
-# Set this to disable renaming of Python scripts containing versioned shebangs
-# and generation of wrapper scripts.
+# Scheduled for deletion on 2011-06-01.
 if [[ -n "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" ]]; then
-	ewarn
-	ewarn "\"${EBUILD}\":"
-	ewarn "Deprecation Warning: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS is deprecated"
-	ewarn "and will be banned on 2011-02-01. Use PYTHON_NONVERSIONED_EXECUTABLES=(\".*\")."
-	ewarn "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
-	ewarn
-
-	PYTHON_NONVERSIONED_EXECUTABLES=(".*")
+	eerror "Use PYTHON_NONVERSIONED_EXECUTABLES=(\".*\") instead of DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS variable."
+	die "DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS variable is banned"
 fi
 
 # @ECLASS-VARIABLE: DOCS
@@ -144,6 +137,48 @@
 	fi
 }
 
+_distutils_prepare_global_options() {
+	local element option pattern
+
+	if [[ -n "$(declare -p DISTUTILS_GLOBAL_OPTIONS 2> /dev/null)" && "$(declare -p DISTUTILS_GLOBAL_OPTIONS)" != "declare -a DISTUTILS_GLOBAL_OPTIONS="* ]]; then
+		die "DISTUTILS_GLOBAL_OPTIONS should be indexed array"
+	fi
+
+	if has "${EAPI:-0}" 0 1 2 3; then
+		_DISTUTILS_GLOBAL_OPTIONS=("${DISTUTILS_GLOBAL_OPTIONS[@]}")
+	else
+		_DISTUTILS_GLOBAL_OPTIONS=()
+
+		for element in "${DISTUTILS_GLOBAL_OPTIONS[@]}"; do
+			if [[ ! "${element}" =~ ^[^[:space:]]+\ . ]]; then
+				die "Element '${element}' of DISTUTILS_GLOBAL_OPTIONS array has invalid syntax"
+			fi
+			pattern="${element%% *}"
+			option="${element#* }"
+			if _python_check_python_abi_matching "${PYTHON_ABI}" "${pattern}"; then
+				_DISTUTILS_GLOBAL_OPTIONS+=("${option}")
+			fi
+		done
+	fi
+}
+
+_distutils_prepare_current_working_directory() {
+	if [[ "$1" == *"|"*"|"* ]]; then
+		die "Element '$1' of DISTUTILS_SETUP_FILES array has invalid syntax"
+	fi
+
+	if [[ "$1" == *"|"* ]]; then
+		echo "${_BOLD}[${1%|*}]${_NORMAL}"
+		pushd "${1%|*}" > /dev/null || die "Entering directory '${1%|*}' failed"
+	fi
+}
+
+_distutils_restore_current_working_directory() {
+	if [[ "$1" == *"|"* ]]; then
+		popd > /dev/null || die "Leaving directory '${1%|*}' failed"
+	fi
+}
+
 # @FUNCTION: distutils_src_unpack
 # @DESCRIPTION:
 # The distutils src_unpack function. This function is exported.
@@ -170,8 +205,15 @@
 		die "${FUNCNAME}() can be used only in src_prepare() phase"
 	fi
 
+	_python_check_python_pkg_setup_execution
+
+	local distribute_setup_existence="0" ez_setup_existence="0"
+
+	if [[ "$#" -ne 0 ]]; then
+		die "${FUNCNAME}() does not accept arguments"
+	fi
+
 	# Delete ez_setup files to prevent packages from installing Setuptools on their own.
-	local ez_setup_existence="0"
 	[[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1"
 	rm -fr ez_setup*
 	if [[ "${ez_setup_existence}" == "1" ]]; then
@@ -179,7 +221,6 @@
 	fi
 
 	# Delete distribute_setup files to prevent packages from installing Distribute on their own.
-	local distribute_setup_existence="0"
 	[[ -d distribute_setup || -f distribute_setup.py ]] && distribute_setup_existence="1"
 	rm -fr distribute_setup*
 	if [[ "${distribute_setup_existence}" == "1" ]]; then
@@ -201,26 +242,40 @@
 		die "${FUNCNAME}() can be used only in src_compile() phase"
 	fi
 
+	_python_check_python_pkg_setup_execution
 	_python_set_color_variables
 
+	local setup_file
+
 	if _python_package_supporting_installation_for_multiple_python_abis; then
 		distutils_building() {
 			_distutils_hook pre
 
-			local setup_file
+			_distutils_prepare_global_options
+
 			for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
-				echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL}
-				"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
+				_distutils_prepare_current_working_directory "${setup_file}"
+
+				echo ${_BOLD}"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL}
+				"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
+
+				_distutils_restore_current_working_directory "${setup_file}"
 			done
 
 			_distutils_hook post
 		}
 		python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_building "$@"
+		unset -f distutils_building
 	else
-		local setup_file
+		_distutils_prepare_global_options
+
 		for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
-			echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL}
-			"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+			_distutils_prepare_current_working_directory "${setup_file}"
+
+			echo ${_BOLD}"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL}
+			"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+
+			_distutils_restore_current_working_directory "${setup_file}"
 		done
 	fi
 }
@@ -257,27 +312,41 @@
 		die "${FUNCNAME}() can be used only in src_test() phase"
 	fi
 
+	_python_check_python_pkg_setup_execution
 	_python_set_color_variables
 
+	local arguments setup_file
+
 	if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
 		if _python_package_supporting_installation_for_multiple_python_abis; then
 			distutils_testing() {
 				_distutils_hook pre
 
-				local setup_file
+				_distutils_prepare_global_options
+
 				for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
-					echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
-					PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" || return "$?"
+					_distutils_prepare_current_working_directory "${setup_file}"
+
+					echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
+					PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" || return "$?"
+
+					_distutils_restore_current_working_directory "${setup_file}"
 				done
 
 				_distutils_hook post
 			}
 			python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@"
+			unset -f distutils_testing
 		else
-			local setup_file
+			_distutils_prepare_global_options
+
 			for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
-				echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL}
-				PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+				_distutils_prepare_current_working_directory "${setup_file}"
+
+				echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL}
+				PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+
+				_distutils_restore_current_working_directory "${setup_file}"
 			done
 		fi
 	elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then
@@ -290,16 +359,15 @@
 		python_execute_py.test -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
 	# trial requires an argument, which is usually equal to "${PN}".
 	elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then
-		local trial_arguments
 		if [[ "${DISTUTILS_SRC_TEST}" == "trial "* ]]; then
-			trial_arguments="${DISTUTILS_SRC_TEST#trial }"
+			arguments="${DISTUTILS_SRC_TEST#trial }"
 		else
-			trial_arguments="${PN}"
+			arguments="${PN}"
 		fi
 
 		_distutils_src_test_hook trial
 
-		python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${trial_arguments} "$@"
+		python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${arguments} "$@"
 	else
 		die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'"
 	fi
@@ -311,56 +379,95 @@
 # In ebuilds of packages supporting installation for multiple versions of Python, this function
 # calls distutils_src_install_pre_hook() and distutils_src_install_post_hook(), if they are defined.
 # It also installs some standard documentation files (AUTHORS, Change*, CHANGELOG, CONTRIBUTORS,
-# KNOWN_BUGS, MAINTAINERS, MANIFEST*, NEWS, PKG-INFO, README*, TODO).
+# KNOWN_BUGS, MAINTAINERS, NEWS, README*, TODO).
 distutils_src_install() {
 	if [[ "${EBUILD_PHASE}" != "install" ]]; then
 		die "${FUNCNAME}() can be used only in src_install() phase"
 	fi
 
+	_python_check_python_pkg_setup_execution
 	_python_initialize_prefix_variables
 	_python_set_color_variables
 
+	local default_docs doc line nspkg_pth_file nspkg_pth_files=() setup_file
+
 	if _python_package_supporting_installation_for_multiple_python_abis; then
 		distutils_installation() {
 			_distutils_hook pre
 
-			local setup_file
+			_distutils_prepare_global_options
+
 			for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
-				echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@"${_NORMAL}
-				"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@" || return "$?"
+				_distutils_prepare_current_working_directory "${setup_file}"
+
+				echo ${_BOLD}"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@"${_NORMAL}
+				"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@" || return "$?"
+
+				_distutils_restore_current_working_directory "${setup_file}"
 			done
 
 			_distutils_hook post
 		}
 		python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_installation "$@"
+		unset -f distutils_installation
 
 		python_merge_intermediate_installation_images "${T}/images"
 	else
 		# Mark the package to be rebuilt after a Python upgrade.
 		python_need_rebuild
 
-		local setup_file
+		_distutils_prepare_global_options
+
 		for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
-			echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL}
-			"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+			_distutils_prepare_current_working_directory "${setup_file}"
+
+			echo ${_BOLD}"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL}
+			"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+
+			_distutils_restore_current_working_directory "${setup_file}"
+		done
+	fi
+
+	while read -d $'\0' -r nspkg_pth_file; do
+		nspkg_pth_files+=("${nspkg_pth_file}")
+	done < <(find "${ED}" -name "*-nspkg.pth" -type f -print0)
+
+	if [[ "${#nspkg_pth_files[@]}" -gt 0 ]]; then
+		einfo
+		einfo "Python namespaces:"
+		for nspkg_pth_file in "${nspkg_pth_files[@]}"; do
+			einfo "    '${nspkg_pth_file#${ED%/}}':"
+			while read -r line; do
+				einfo "        $(echo "${line}" | sed -e "s/.*types\.ModuleType('\([^']\+\)').*/\1/")"
+			done < "${nspkg_pth_file}"
+			if ! has "${EAPI:-0}" 0 1 2 3; then
+				rm -f "${nspkg_pth_file}" || die "Deletion of '${nspkg_pth_file}' failed"
+			fi
 		done
+		einfo
 	fi
 
 	if [[ -e "${ED}usr/local" ]]; then
 		die "Illegal installation into /usr/local"
 	fi
 
-	local default_docs
-	default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS MANIFEST* NEWS PKG-INFO README* TODO"
+	default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS NEWS README* TODO"
 
-	local doc
 	for doc in ${default_docs}; do
 		[[ -s "${doc}" ]] && dodoc "${doc}"
 	done
 
-	if [[ -n "${DOCS}" ]]; then
-		dodoc ${DOCS} || die "dodoc failed"
+	if has "${EAPI:-0}" 0 1 2 3; then
+		if [[ -n "${DOCS}" ]]; then
+			dodoc ${DOCS} || die "dodoc failed"
+		fi
+	else
+		if [[ -n "${DOCS}" ]]; then
+			dodoc -r ${DOCS} || die "dodoc failed"
+		fi
 	fi
+
+	DISTUTILS_SRC_INSTALL_EXECUTED="1"
 }
 
 # @FUNCTION: distutils_pkg_postinst
@@ -374,9 +481,19 @@
 		die "${FUNCNAME}() can be used only in pkg_postinst() phase"
 	fi
 
+	_python_check_python_pkg_setup_execution
 	_python_initialize_prefix_variables
 
+	if [[ -z "${DISTUTILS_SRC_INSTALL_EXECUTED}" ]]; then
+		die "${FUNCNAME}() called illegally"
+	fi
+
 	local pylibdir pymod
+
+	if [[ "$#" -ne 0 ]]; then
+		die "${FUNCNAME}() does not accept arguments"
+	fi
+
 	if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
 		for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"usr/share/jython-*/Lib; do
 			if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
@@ -407,9 +524,19 @@
 		die "${FUNCNAME}() can be used only in pkg_postrm() phase"
 	fi
 
+	_python_check_python_pkg_setup_execution
 	_python_initialize_prefix_variables
 
+	if [[ -z "${DISTUTILS_SRC_INSTALL_EXECUTED}" ]]; then
+		die "${FUNCNAME}() called illegally"
+	fi
+
 	local pylibdir pymod
+
+	if [[ "$#" -ne 0 ]]; then
+		die "${FUNCNAME}() does not accept arguments"
+	fi
+
 	if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
 		for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"usr/share/jython-*/Lib; do
 			if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
@@ -433,14 +560,29 @@
 	fi
 }
 
-# Scheduled for deletion on 2011-01-01.
-distutils_python_version() {
-	eerror "Use PYTHON() instead of python variable. Use python_get_*() instead of PYVER* variables."
-	die "${FUNCNAME}() is banned"
-}
+# @FUNCTION: distutils_get_intermediate_installation_image
+# @DESCRIPTION:
+# Print path to intermediate installation image.
+#
+# This function can be used only in distutils_src_install_pre_hook() and distutils_src_install_post_hook().
+distutils_get_intermediate_installation_image() {
+	if [[ "${EBUILD_PHASE}" != "install" ]]; then
+		die "${FUNCNAME}() can be used only in src_install() phase"
+	fi
+
+	if ! _python_package_supporting_installation_for_multiple_python_abis; then
+		die "${FUNCNAME}() cannot be used in ebuilds of packages not supporting installation for multiple Python ABIs"
+	fi
+
+	_python_check_python_pkg_setup_execution
+
+	if [[ ! "${FUNCNAME[1]}" =~ ^distutils_src_install_(pre|post)_hook$ ]]; then
+		die "${FUNCNAME}() can be used only in distutils_src_install_pre_hook() and distutils_src_install_post_hook()"
+	fi
+
+	if [[ "$#" -ne 0 ]]; then
+		die "${FUNCNAME}() does not accept arguments"
+	fi
 
-# Scheduled for deletion on 2011-01-01.
-distutils_python_tkinter() {
-	eerror "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()."
-	die "${FUNCNAME}() is banned"
+	echo "${T}/images/${PYTHON_ABI}"
 }






             reply	other threads:[~2011-04-12 18:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 18:49 Arfrever Frehtes Taifersar Arahesis (arfrever) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-12-24 15:05 [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-12-13 13:36 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-10-10 19:23 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-07-17 23:03 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-05-25 15:07 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-03-04 17:49 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-28 11:52 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-08  9:35 Peter Volkov (pva)
2010-02-07 21:17 Peter Volkov (pva)
2010-02-04 18:31 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-01-10 17:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-12-24  4:21 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-11-28 18:39 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-11-06  0:35 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-10-11 13:38 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-11 20:03 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-11 12:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-09 19:26 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-07  2:34 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-05 16:45 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-12  2:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-05 18:34 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-02  0:30 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-02-18 14:43 Peter Volkov (pva)
2008-10-28 21:29 Ali Polatel (hawking)
2008-10-27  0:19 Ali Polatel (hawking)
2008-09-24 16:45 Ali Polatel (hawking)
2008-06-28  0:05 Luca Longinotti (chtekk)
2008-06-24 13:40 Ali Polatel (hawking)
2008-06-20 18:21 Ali Polatel (hawking)
2008-05-30 10:22 Ali Polatel (hawking)
2008-05-29 15:24 Ali Polatel (hawking)
2008-01-23 22:19 Ali Polatel (hawking)
2007-10-25 13:49 Ali Polatel (hawking)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110412184903.352C620054@flycatcher.gentoo.org \
    --to=arfrever@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox