Fix FetchlistDict.keys() so it does the same porttrees trick as __getitem__.
authorZac Medico <zmedico@gentoo.org>
Tue, 11 Apr 2006 01:51:58 +0000 (01:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 11 Apr 2006 01:51:58 +0000 (01:51 -0000)
svn path=/main/trunk/; revision=3120

pym/portage.py

index 367f4354484d4e1c6d9cf286e0e36fbf3905c7d8..0c0fe13fe2171f28dd99c8572e1659097f2097ad 100644 (file)
@@ -6376,7 +6376,14 @@ class FetchlistDict(UserDict.DictMixin):
                return pkg_key in self.keys()
        def keys(self):
                """Returns keys for all packages within pkgdir"""
-               return self.db.cp_list(self.cp)
+               global portdb # has the global auxdb caches
+               all_trees = portdb.porttrees
+               # This ensures that the key list comes from the correct portage tree.
+               portdb.porttrees = self.porttrees
+               mykeys = portdb.cp_list(self.cp)
+               # XXX The db is global so we restore it's trees back to their original state.
+               portdb.porttrees = all_trees
+               return mykeys
 
 def cleanup_pkgmerge(mypkg,origdir):
        shutil.rmtree(settings["PORTAGE_TMPDIR"]+"/binpkgs/"+mypkg)