slot_collision_handler: Fix bug related to highlight_violations (bug 336085)
authorSebastian Luther <SebastianLuther@gmx.de>
Mon, 6 Sep 2010 14:44:34 +0000 (16:44 +0200)
committerZac Medico <zmedico@gentoo.org>
Mon, 6 Sep 2010 16:46:42 +0000 (09:46 -0700)
pym/_emerge/resolver/slot_collision.py

index 3305622ad7482eba009335bb7ae7ff22ed3a207c..e68543bf5f2faa422de1fee16bb14d1f62e03a75 100644 (file)
@@ -321,18 +321,14 @@ class slot_conflict_handler(object):
                                                        # Package types.
                                                        version_violated = False
                                                        use = []
-                                                       for type, sub_type in collision_reasons:
-                                                               if type == "version":
-                                                                       for x in collision_reasons[(type, sub_type)]:
-                                                                               if ppkg == x[0] and atom == x[1]:
+                                                       for (type, sub_type), parents in collision_reasons.items():
+                                                               for x in parents:
+                                                                       if parent == x[0] and atom == x[1]:
+                                                                               if type == "version":
                                                                                        version_violated = True
-                                                               elif type == "use":
-                                                                       for x in collision_reasons[(type, sub_type)]:
-                                                                               # TODO: Review this conditional for
-                                                                               # validity (see bug #336085).
-                                                                               if ppkg == x[0] and atom == x[1]:
+                                                                               elif type == "use":
                                                                                        use.append(sub_type)
-                                                                                       break
+                                                                               break
 
                                                        atom_str = highlight_violations(atom.unevaluated_atom, version_violated, use)