diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-01-14 03:56:21 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-01-14 03:56:21 +0000 |
commit | 4315308f506bb770338f7d2cc9c569d6a7440d1b (patch) | |
tree | 061e243bc505d968d3d6d68ac8a984ebe8f6e097 | |
parent | 080e480a284db7563aae8f38772bcdc7ca6cdd64 (diff) | |
download | portage-4315308f506bb770338f7d2cc9c569d6a7440d1b.tar.gz portage-4315308f506bb770338f7d2cc9c569d6a7440d1b.tar.bz2 portage-4315308f506bb770338f7d2cc9c569d6a7440d1b.zip |
Simplify depgraph._select_pkg_from_graph() by using match_pkgs(). (trunk r12494)
svn path=/main/branches/2.1.6/; revision=12504
-rw-r--r-- | pym/_emerge/__init__.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 9d2d62d03..130bf7ecf 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6218,19 +6218,12 @@ class depgraph(object): replacement. """ graph_db = self._graph_trees[root]["porttree"].dbapi - matches = graph_db.match(atom) + matches = graph_db.match_pkgs(atom) if not matches: return None, None - cpv = matches[-1] # highest match - slot_atom = "%s:%s" % (portage.cpv_getkey(cpv), - graph_db.aux_get(cpv, ["SLOT"])[0]) - e_pkg = self._slot_pkg_map[root].get(slot_atom) - if e_pkg: - return e_pkg, e_pkg - # 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) + pkg = matches[-1] # highest match + in_graph = self._slot_pkg_map[root].get(pkg.slot_atom) + return pkg, in_graph def _complete_graph(self): """ |