diff options
author | Michał Górny <mgorny@gentoo.org> | 2012-12-07 17:55:04 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2012-12-07 17:55:04 +0000 |
commit | 176c845b7ac822341c675800ccb4acc53ac5d92e (patch) | |
tree | bbd2da2e0fa5c8cebcaa9296f7ce1817f6d46580 /eclass/distutils-r1.eclass | |
parent | www-servers/tomcat: updated elog with migration information (diff) | |
download | gentoo-2-176c845b7ac822341c675800ccb4acc53ac5d92e.tar.gz gentoo-2-176c845b7ac822341c675800ccb4acc53ac5d92e.tar.bz2 gentoo-2-176c845b7ac822341c675800ccb4acc53ac5d92e.zip |
Pass the best Python implementation info to the implementation-common phase functions.
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r-- | eclass/distutils-r1.eclass | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index b1b3f9048506..4e097f8c29ef 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.24 2012/12/01 10:54:50 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.25 2012/12/07 17:55:04 mgorny Exp $ # @ECLASS: distutils-r1 # @MAINTAINER: @@ -388,6 +388,27 @@ distutils-r1_run_phase() { if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then popd &>/dev/null || die fi + + # Store them for reuse. + _DISTUTILS_BEST_IMPL=( + "${EPYTHON}" "${PYTHON}" "${BUILD_DIR}" "${PYTHONPATH}" + ) +} + +# @FUNCTION: _distutils-r1_run_common_phase +# @USAGE: [<argv>...] +# @INTERNAL +# @DESCRIPTION: +# Run the given command, restoring the best-implementation state. +_distutils-r1_run_common_phase() { + local EPYTHON=${_DISTUTILS_BEST_IMPL[0]} + local PYTHON=${_DISTUTILS_BEST_IMPL[1]} + local BEST_BUILD_DIR=${_DISTUTILS_BEST_IMPL[2]} + local PYTHONPATH=${_DISTUTILS_BEST_IMPL[3]} + + export EPYTHON PYTHON PYTHONPATH + + "${@}" } distutils-r1_src_prepare() { @@ -419,7 +440,7 @@ distutils-r1_src_configure() { multijob_finish if declare -f python_configure_all >/dev/null; then - python_configure_all + _distutils-r1_run_common_phase python_configure_all fi } @@ -435,7 +456,7 @@ distutils-r1_src_compile() { multijob_finish if declare -f python_compile_all >/dev/null; then - python_compile_all + _distutils-r1_run_common_phase python_compile_all fi } @@ -451,7 +472,7 @@ distutils-r1_src_test() { multijob_finish if declare -f python_test_all >/dev/null; then - python_test_all + _distutils-r1_run_common_phase python_test_all fi } @@ -467,9 +488,9 @@ distutils-r1_src_install() { multijob_finish if declare -f python_install_all >/dev/null; then - python_install_all + _distutils-r1_run_common_phase python_install_all else - distutils-r1_python_install_all + _distutils-r1_run_common_phase distutils-r1_python_install_all fi } |