diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-04-10 05:17:36 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-04-10 05:17:36 +0000 |
commit | 04affbd0f1d6f476d25893e503af1f291a7ba72f (patch) | |
tree | 9899f6c0a2dde6aa94f1f5dd4b3bd4ab098fe23a | |
parent | eb626722018f342fc58d7e7004f16d59145b2480 (diff) | |
download | portage-04affbd0f1d6f476d25893e503af1f291a7ba72f.tar.gz portage-04affbd0f1d6f476d25893e503af1f291a7ba72f.tar.bz2 portage-04affbd0f1d6f476d25893e503af1f291a7ba72f.zip |
Improve used of cached Package instances in depgraph._select_pkg_from_graph().
svn path=/main/trunk/; revision=9787
-rw-r--r-- | pym/_emerge/__init__.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 828144ece..2b3b9d58b 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1669,7 +1669,6 @@ class depgraph(object): self._select_atoms = self._select_atoms_highest_available self._select_package = self._select_pkg_highest_available self._highest_pkg_cache = {} - self._installed_pkg_cache = {} def _show_slot_collision_notice(self): """Show an informational message advising the user to mask one of the @@ -2839,18 +2838,10 @@ class depgraph(object): e_pkg = self._slot_pkg_map[root].get(slot_atom) if e_pkg: return e_pkg, e_pkg - cache_key = (root, atom, onlydeps) - ret = self._installed_pkg_cache.get(cache_key) - if ret is not None: - return ret - metadata = dict(izip(self._mydbapi_keys, - graph_db.aux_get(cpv, self._mydbapi_keys))) - pkg = Package(cpv=cpv, built=True, - installed=True, type_name="installed", - metadata=metadata, root=root) - ret = (pkg, None) - self._installed_pkg_cache[cache_key] = ret - return ret + # Since this cpv exists in the graph_db, + # we must have a cached Package instance. + cache_key = ("installed", root, cpv, "nomerge") + return (self._pkg_cache[cache_key], None) def _complete_graph(self): """ |