python-utils-r1.eclass: python_wrapper_setup, fix exporting env
authorMichał Górny <mgorny@gentoo.org>
Sun, 26 Feb 2017 10:02:07 +0000 (11:02 +0100)
committerMichał Górny <mgorny@gentoo.org>
Wed, 8 Mar 2017 07:35:39 +0000 (08:35 +0100)
Fix python_wrapper_setup function to move setting environment variables
for PATH and PKG_CONFIG_PATH outside the 'if'. Otherwise, they are only
set on the initial invocation of python_wrapper_setup for the particular
impl and do not apply to subsequent invocations (e.g. further
distutils-r1 phases).

eclass/python-utils-r1.eclass

index 3937d066a095f4985af774b8f7cc695bddfa08c8..0cc5b963998e3d39b5adf1840c316c63c66de68b 100644 (file)
@@ -984,18 +984,18 @@ python_wrapper_setup() {
                        _EOF_
                        chmod +x "${workdir}"/bin/${x} || die
                done
+       fi
 
-               # Now, set the environment.
-               # But note that ${workdir} may be shared with something else,
-               # and thus already on top of PATH.
-               if [[ ${PATH##:*} != ${workdir}/bin ]]; then
-                       PATH=${workdir}/bin${PATH:+:${PATH}}
-               fi
-               if [[ ${PKG_CONFIG_PATH##:*} != ${workdir}/pkgconfig ]]; then
-                       PKG_CONFIG_PATH=${workdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
-               fi
-               export PATH PKG_CONFIG_PATH
+       # Now, set the environment.
+       # But note that ${workdir} may be shared with something else,
+       # and thus already on top of PATH.
+       if [[ ${PATH##:*} != ${workdir}/bin ]]; then
+               PATH=${workdir}/bin${PATH:+:${PATH}}
+       fi
+       if [[ ${PKG_CONFIG_PATH##:*} != ${workdir}/pkgconfig ]]; then
+               PKG_CONFIG_PATH=${workdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
        fi
+       export PATH PKG_CONFIG_PATH
 }
 
 # @FUNCTION: python_is_python3