public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] distutils-r1.eclass: Set PATH in distutils_install_for_testing
@ 2020-08-01 20:37 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2020-08-01 20:37 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Make distutils_install_for_testing set PATH so that newly-installed
scripts are available in the testing environment.  Make PATH local
in all sub-phases to make modifications safe.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 092c0887d878..e0e7a945ab87 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -561,6 +561,7 @@ distutils_install_for_testing() {
 	TEST_DIR=${BUILD_DIR}/test
 	local bindir=${TEST_DIR}/scripts
 	local libdir=${TEST_DIR}/lib
+	PATH=${bindir}:${PATH}
 	PYTHONPATH=${libdir}:${PYTHONPATH}
 
 	local add_args=(
@@ -951,6 +952,11 @@ distutils-r1_run_phase() {
 	fi
 	local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
 
+	# make PATH local for distutils_install_for_testing calls
+	# it makes little sense to let user modify PATH in per-impl phases
+	# and _all() already localizes it
+	local -x PATH=${PATH}
+
 	# Bug 559644
 	# using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet might lead to
 	# problems in setup.py scripts that try to import modules/packages from that path
-- 
2.28.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-01 20:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-01 20:37 [gentoo-dev] [PATCH] distutils-r1.eclass: Set PATH in distutils_install_for_testing Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox