summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-04-22 12:36:23 -0700
committerZac Medico <zmedico@gentoo.org>2010-04-22 12:36:23 -0700
commit6fd46254fbaf7482d5c72cfe6cf5ef31b2407a1f (patch)
tree4835ee74709577896ff423b7e3636ccb96788ee8
parentSource isolated-functions.sh for vecho definition. Thanks to Martin MOKREJŠ (diff)
downloadportage-idfetch-6fd46254fbaf7482d5c72cfe6cf5ef31b2407a1f.tar.gz
portage-idfetch-6fd46254fbaf7482d5c72cfe6cf5ef31b2407a1f.tar.bz2
portage-idfetch-6fd46254fbaf7482d5c72cfe6cf5ef31b2407a1f.zip
Automatically add PORTAGE_BIN_PATH to the front of PATH.
-rwxr-xr-xpym/portage/tests/runTests7
1 files changed, 7 insertions, 0 deletions
diff --git a/pym/portage/tests/runTests b/pym/portage/tests/runTests
index 3afe8e20..8e8a3a44 100755
--- a/pym/portage/tests/runTests
+++ b/pym/portage/tests/runTests
@@ -11,6 +11,13 @@ import os.path as osp
sys.path.insert(0, osp.dirname(osp.dirname(osp.dirname(osp.abspath(__file__)))))
import portage.tests as tests
+from portage.const import PORTAGE_BIN_PATH
+path = os.environ.get("PATH", "").split(":")
+path = [x for x in path if x]
+if not path or not os.path.samefile(path[0], PORTAGE_BIN_PATH):
+ path.insert(0, PORTAGE_BIN_PATH)
+ os.environ["PATH"] = ":".join(path)
+del path
if __name__ == "__main__":
result = tests.main()