Make DepcheckCompositeDB cache Package instances for aux_get() calls.
authorZac Medico <zmedico@gentoo.org>
Wed, 9 Apr 2008 17:02:10 +0000 (17:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 9 Apr 2008 17:02:10 +0000 (17:02 -0000)
(trunk r9771)

svn path=/main/branches/2.1.2/; revision=9772

bin/emerge

index 27fac55ab667258b87d3ca9791719b12a70a3301..eab47a44d2dd1c7cc7784f1172d7259415aef83d 100755 (executable)
@@ -1555,7 +1555,7 @@ class DepcheckCompositeDB(object):
                self._depgraph = depgraph
                self._root = root
                self._match_cache = {}
-               self._cpv_tree_map = {}
+               self._cpv_pkg_map = {}
 
        def match(self, atom):
                ret = self._match_cache.get(atom)
@@ -1578,15 +1578,14 @@ class DepcheckCompositeDB(object):
                                # atoms or packages to be selected if available.
                                ret = []
                        if ret is None:
-                               self._cpv_tree_map[pkg.cpv] = \
-                                       self._depgraph.pkg_tree_map[pkg.type_name]
+                               self._cpv_pkg_map[pkg.cpv] = pkg
                                ret = [pkg.cpv]
                self._match_cache[atom] = ret
                return ret[:]
 
        def aux_get(self, cpv, wants):
-               return self._depgraph.trees[self._root][
-                       self._cpv_tree_map[cpv]].dbapi.aux_get(cpv, wants)
+               metadata = self._cpv_pkg_map[cpv].metadata
+               return [metadata.get(x, "") for x in wants]
 
 class depgraph(object):