From: Zac Medico Date: Wed, 9 Apr 2008 17:02:10 +0000 (-0000) Subject: Make DepcheckCompositeDB cache Package instances for aux_get() calls. X-Git-Tag: v2.1.5~224 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f963cfd735d24bb18a34246def971387157dc85e;p=portage.git Make DepcheckCompositeDB cache Package instances for aux_get() calls. (trunk r9771) svn path=/main/branches/2.1.2/; revision=9772 --- diff --git a/bin/emerge b/bin/emerge index 27fac55ab..eab47a44d 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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):