Fix depgraph._get_arg_for_pkg() so that it compares package
authorZac Medico <zmedico@gentoo.org>
Sun, 11 Nov 2007 08:47:43 +0000 (08:47 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 11 Nov 2007 08:47:43 +0000 (08:47 -0000)
types to help ensure a proper match.

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

pym/_emerge/__init__.py

index b6541bd4735739d73b1bbf1dd47e980935b9a248..97fc0e1aba2a99d0d801372514d4024bb9b439f8 100644 (file)
@@ -1708,9 +1708,13 @@ class depgraph(object):
                for atom in self._set_atoms.iterAtomsForPackage(pkg):
                        refs = atom_arg_map[(atom, pkg.root)]
                        for arg in refs:
-                               any_arg = arg
                                if isinstance(arg, PackageArg):
+                                       # TODO: Implement a better comparison to ensure that
+                                       #       these two packages really are identical.
+                                       if arg.package.type_name != pkg.type_name:
+                                               continue
                                        return arg
+                               any_arg = arg
                return any_arg
 
        def select_files(self, myfiles):