Make paths independent of cwd.
authorZac Medico <zmedico@gentoo.org>
Sat, 17 Mar 2007 08:41:09 +0000 (08:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 17 Mar 2007 08:41:09 +0000 (08:41 -0000)
svn path=/main/trunk/; revision=6232

pym/portage/tests/bin/setup_env.py

index cde720d9972bfd028a7c6feba2bafcd1d8393af6..f6ff59ff1d9586b0686518f1a9810ed5111f6806 100644 (file)
@@ -4,11 +4,12 @@
 # $Id: test_dep_getcpv.py 6182 2007-03-06 07:35:22Z antarus $
 
 import os, shutil, sys
+from os.path import dirname, abspath, join
 from portage.tests import TestCase
 from portage.process import spawn
 
-bindir = os.path.join(os.getcwd(), "..", "..", "..", "bin")
-basedir = os.path.join(os.getcwd(), "bin", "root")
+bindir = join(dirname(dirname(abspath(__file__))), "..", "..", "..", "bin")
+basedir = join(dirname(dirname(abspath(__file__))), "bin", "root")
 os.environ["D"] = os.path.join(basedir, "image")
 os.environ["T"] = os.path.join(basedir, "temp")
 os.environ["S"] = os.path.join(basedir, "workdir")