Simplify the porttrees logic for FetchlistDict.
authorZac Medico <zmedico@gentoo.org>
Mon, 10 Apr 2006 04:28:22 +0000 (04:28 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 10 Apr 2006 04:28:22 +0000 (04:28 -0000)
svn path=/main/trunk/; revision=3113

pym/portage.py

index b4cbf607f2ed62969558b3c48e0663abb9150bb7..33b57718f0746fded7318a0a9eae5f59b3070d23 100644 (file)
@@ -6349,12 +6349,9 @@ class FetchlistDict(UserDict.DictMixin):
                self.cp = os.sep.join(pkgdir.split(os.sep)[-2:])
                self.settings = settings
                self.db = portagetree().dbapi
-               porttree = os.path.dirname(os.path.dirname(pkgdir))
-               porttree_key = os.path.normpath(os.path.realpath(porttree)).strip(os.sep)
+               porttree = os.sep + os.path.normpath(os.path.dirname(os.path.dirname(pkgdir))).strip(os.sep)
                # This ensures that the fetchlist comes from the correct portage tree.
-               for t in self.db.porttrees:
-                       if os.path.normpath(os.path.realpath(t)).strip(os.sep) != porttree_key:
-                               self.db.porttrees.remove(t)
+               self.db.porttrees = [porttree]
        def __getitem__(self, pkg_key):
                return self.db.getfetchlist(pkg_key, mysettings=self.settings, all=True)[1]
        def has_key(self, pkg_key):