Never do realpath() on an empty string for portdbapi.porttree_root since
authorZac Medico <zmedico@gentoo.org>
Tue, 1 Jul 2008 08:43:10 +0000 (08:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 1 Jul 2008 08:43:10 +0000 (08:43 -0000)
otherwise it can evaluate to $CWD which leads to undesireable results.

svn path=/main/trunk/; revision=10867

pym/portage/dbapi/porttree.py

index b6e39f63b44d4c4c74610eb9b4d35a04d9c3d748..e2a53aac4443375f02957ecdee3cea3460bef560 100644 (file)
@@ -63,7 +63,9 @@ class portdbapi(dbapi):
                                self.manifestVerifier = portage.gpg.FileChecker(self.mysettings["PORTAGE_GPG_DIR"], "gentoo.gpg", minimumTrust=self.manifestVerifyLevel)
 
                #self.root=settings["PORTDIR"]
-               self.porttree_root = os.path.realpath(porttree_root)
+               self.porttree_root = porttree_root
+               if porttree_root:
+                       self.porttree_root = os.path.realpath(porttree_root)
 
                self.depcachedir = os.path.realpath(self.mysettings.depcachedir)