Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/7] python-utils-r1.eclass: set PYTHON locally in python_export()
Date: Sun, 08 Nov 2015 09:36:46
Message-Id: 1446975311-19708-3-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCHES] python-utils-r1.eclass: Getter cleanup & ABIFLAGS preparation by "Michał Górny"
1 Ensure that PYTHON is always set inside python_export() for convenience.
2 If it wasn't requested for explicit export, make it a local variable.
3 ---
4 eclass/python-utils-r1.eclass | 8 +++++++-
5 1 file changed, 7 insertions(+), 1 deletion(-)
6
7 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
8 index a80bdf4..69166cf 100644
9 --- a/eclass/python-utils-r1.eclass
10 +++ b/eclass/python-utils-r1.eclass
11 @@ -248,6 +248,12 @@ python_export() {
12 esac
13 debug-print "${FUNCNAME}: implementation: ${impl}"
14
15 + # make sure it doesn't leave our function unless desired
16 + if ! has PYTHON "${@}"; then
17 + local PYTHON
18 + fi
19 + export PYTHON=${EPREFIX}/usr/bin/${impl}
20 +
21 for var; do
22 case "${var}" in
23 EPYTHON)
24 @@ -255,7 +261,7 @@ python_export() {
25 debug-print "${FUNCNAME}: EPYTHON = ${EPYTHON}"
26 ;;
27 PYTHON)
28 - export PYTHON=${EPREFIX}/usr/bin/${impl}
29 + # already exported above
30 debug-print "${FUNCNAME}: PYTHON = ${PYTHON}"
31 ;;
32 PYTHON_SITEDIR)
33 --
34 2.6.3