summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-01-13 04:43:40 +0000
committerZac Medico <zmedico@gentoo.org>2009-01-13 04:43:40 +0000
commit7e22518ce045cfdd4137c021caa101bb790eef1d (patch)
treeb854b7ed1d7029085b8dbd8e8628bf506f4d8c65
parent67cc81bc395010aae55606879c5b0fe515a9be36 (diff)
downloadportage-7e22518ce045cfdd4137c021caa101bb790eef1d.tar.gz
portage-7e22518ce045cfdd4137c021caa101bb790eef1d.tar.bz2
portage-7e22518ce045cfdd4137c021caa101bb790eef1d.zip
Simplify depgraph._select_pkg_from_graph() by using match_pkgs().
svn path=/main/trunk/; revision=12494
-rw-r--r--pym/_emerge/__init__.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 9e8d343a9..796275588 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6234,19 +6234,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):
"""