Fix breakage in depgraph._serialize_tasks() blocker handling due
authorZac Medico <zmedico@gentoo.org>
Mon, 27 Sep 2010 23:55:53 +0000 (16:55 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 5 Oct 2010 15:51:21 +0000 (08:51 -0700)
to addition of repo to Package._hash_key.

pym/_emerge/depgraph.py

index 5bb2be2883625bb0d01529fc55fe3687a0d03c67..aa6992f5582db7709b98d0b3b26a9da6f542e388 100644 (file)
@@ -4330,13 +4330,17 @@ class depgraph(object):
                                        uninst_task = node
                                else:
                                        vardb = self._frozen_config.trees[node.root]["vartree"].dbapi
-                                       previous_cpv = vardb.match(node.slot_atom)
-                                       if previous_cpv:
+                                       inst_pkg = vardb.match_pkgs(node.slot_atom)
+                                       if inst_pkg:
                                                # The package will be replaced by this one, so remove
                                                # the corresponding Uninstall task if necessary.
-                                               previous_cpv = previous_cpv[0]
-                                               uninst_task = \
-                                                       ("installed", node.root, previous_cpv, "uninstall")
+                                               inst_pkg = inst_pkg[0]
+                                               uninst_task = Package(built=inst_pkg.built,
+                                                       cpv=inst_pkg.cpv, installed=inst_pkg.installed,
+                                                       metadata=inst_pkg.metadata,
+                                                       operation="uninstall",
+                                                       root_config=inst_pkg.root_config,
+                                                       type_name=inst_pkg.type_name)
                                                try:
                                                        mygraph.remove(uninst_task)
                                                except KeyError: