In depgraph._complete_graph(), use cached Package instances instead
authorZac Medico <zmedico@gentoo.org>
Fri, 2 May 2008 19:02:46 +0000 (19:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 2 May 2008 19:02:46 +0000 (19:02 -0000)
of constructing new ones.

svn path=/main/trunk/; revision=10096

pym/_emerge/__init__.py

index faa0a83e89cbf890e36527945df0654ffc8d93a1..5062550877b27eef69769070001c924bdfe52ab1 100644 (file)
@@ -3094,7 +3094,7 @@ class depgraph(object):
                        # that are initially satisfied.
                        while self._unsatisfied_deps:
                                dep = self._unsatisfied_deps.pop()
-                               matches = vardb.match(dep.atom)
+                               matches = vardb.match_pkgs(dep.atom)
                                if not matches:
                                        # Initially unsatisfied.
                                        continue
@@ -3102,12 +3102,7 @@ class depgraph(object):
                                # Add the installed package to the graph so that it
                                # will be appropriately reported as a slot collision
                                # (possibly solvable via backtracking).
-                               cpv = matches[-1] # highest match
-                               metadata = dict(izip(self._mydbapi_keys,
-                                       vardb.aux_get(cpv, self._mydbapi_keys)))
-                               pkg = Package(type_name="installed", root=root,
-                                       cpv=cpv, metadata=metadata, built=True,
-                                       installed=True)
+                               pkg = matches[-1] # highest match
                                if not self._add_pkg(pkg, dep.parent,
                                        priority=dep.priority, depth=dep.depth):
                                        return 0