From 2294ab232de72853ded186a5580caeb791091445 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 8 Jul 2011 07:43:38 +0000 Subject: Fix handling of ROOT in wrapper scripts generated by python_generate_wrapper_scripts(). (Patch by Arfrever. Backported from python overlay.) --- eclass/python.eclass | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'eclass') diff --git a/eclass/python.eclass b/eclass/python.eclass index 56cc61b51ba8..ca9a6ad96390 100644 --- a/eclass/python.eclass +++ b/eclass/python.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.121 2011/07/08 07:41:56 djc Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.122 2011/07/08 07:43:38 djc Exp $ # @ECLASS: python.eclass # @MAINTAINER: @@ -1256,7 +1256,9 @@ if EPYTHON: sys.exit(1) else: try: - eselect_process = subprocess.Popen(["${EPREFIX}/usr/bin/eselect", "python", "show"${eselect_python_option:+, $(echo "\"")}${eselect_python_option}${eselect_python_option:+$(echo "\"")}], stdout=subprocess.PIPE) + environment = os.environ.copy() + environment["ROOT"] = "/" + eselect_process = subprocess.Popen(["${EPREFIX}/usr/bin/eselect", "python", "show"${eselect_python_option:+, $(echo "\"")}${eselect_python_option}${eselect_python_option:+$(echo "\"")}], env=environment, stdout=subprocess.PIPE) if eselect_process.wait() != 0: raise ValueError except (OSError, ValueError): @@ -1286,7 +1288,9 @@ EOF else cat << EOF >> "${file}" try: - eselect_process = subprocess.Popen(["${EPREFIX}/usr/bin/eselect", "python", "show"${eselect_python_option:+, $(echo "\"")}${eselect_python_option}${eselect_python_option:+$(echo "\"")}], stdout=subprocess.PIPE) + environment = os.environ.copy() + environment["ROOT"] = "/" + eselect_process = subprocess.Popen(["${EPREFIX}/usr/bin/eselect", "python", "show"${eselect_python_option:+, $(echo "\"")}${eselect_python_option}${eselect_python_option:+$(echo "\"")}], env=environment, stdout=subprocess.PIPE) if eselect_process.wait() != 0: raise ValueError except (OSError, ValueError): @@ -1758,14 +1762,14 @@ PYTHON() { _python_calculate_PYTHON_ABIS PYTHON_ABI="${PYTHON_ABIS##* }" elif [[ "${python2}" == "1" ]]; then - PYTHON_ABI="$(eselect python show --python2 --ABI)" + PYTHON_ABI="$(ROOT="/" eselect python show --python2 --ABI)" if [[ -z "${PYTHON_ABI}" ]]; then die "${FUNCNAME}(): Active version of CPython 2 not set" elif [[ "${PYTHON_ABI}" != "2."* ]]; then die "${FUNCNAME}(): Internal error in \`eselect python show --python2\`" fi elif [[ "${python3}" == "1" ]]; then - PYTHON_ABI="$(eselect python show --python3 --ABI)" + PYTHON_ABI="$(ROOT="/" eselect python show --python3 --ABI)" if [[ -z "${PYTHON_ABI}" ]]; then die "${FUNCNAME}(): Active version of CPython 3 not set" elif [[ "${PYTHON_ABI}" != "3."* ]]; then -- cgit v1.2.3-65-gdbad