Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] python-utils-r1.eclass: python_wrapper_setup, fix exporting env
Date: Sun, 26 Feb 2017 21:54:48
Message-Id: 20170226215424.31175-1-mgorny@gentoo.org
1 Fix python_wrapper_setup function to move setting environment variables
2 for PATH and PKG_CONFIG_PATH outside the 'if'. Otherwise, they are only
3 set on the initial invocation of python_wrapper_setup for the particular
4 impl and do not apply to subsequent invocations (e.g. further
5 distutils-r1 phases).
6 ---
7 eclass/python-utils-r1.eclass | 20 ++++++++++----------
8 1 file changed, 10 insertions(+), 10 deletions(-)
9
10 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
11 index 572f68fc9828..dd42d2c9aad9 100644
12 --- a/eclass/python-utils-r1.eclass
13 +++ b/eclass/python-utils-r1.eclass
14 @@ -985,18 +985,18 @@ python_wrapper_setup() {
15 _EOF_
16 chmod +x "${workdir}"/bin/${x} || die
17 done
18 + fi
19
20 - # Now, set the environment.
21 - # But note that ${workdir} may be shared with something else,
22 - # and thus already on top of PATH.
23 - if [[ ${PATH##:*} != ${workdir}/bin ]]; then
24 - PATH=${workdir}/bin${PATH:+:${PATH}}
25 - fi
26 - if [[ ${PKG_CONFIG_PATH##:*} != ${workdir}/pkgconfig ]]; then
27 - PKG_CONFIG_PATH=${workdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
28 - fi
29 - export PATH PKG_CONFIG_PATH
30 + # Now, set the environment.
31 + # But note that ${workdir} may be shared with something else,
32 + # and thus already on top of PATH.
33 + if [[ ${PATH##:*} != ${workdir}/bin ]]; then
34 + PATH=${workdir}/bin${PATH:+:${PATH}}
35 + fi
36 + if [[ ${PKG_CONFIG_PATH##:*} != ${workdir}/pkgconfig ]]; then
37 + PKG_CONFIG_PATH=${workdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
38 fi
39 + export PATH PKG_CONFIG_PATH
40 }
41
42 # @FUNCTION: python_is_python3
43 --
44 2.12.0

Replies