Eliminate duplicate code inside depgraph._show_missed_update().
authorZac Medico <zmedico@gentoo.org>
Sat, 11 Jul 2009 22:19:37 +0000 (22:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 11 Jul 2009 22:19:37 +0000 (22:19 -0000)
svn path=/main/trunk/; revision=13817

pym/_emerge/depgraph.py

index 42fb869f3a85c0252ab3f25e79c51e271324a9d8..11b4b496354f1cc7133d249a57cd359896167a0e 100644 (file)
@@ -274,20 +274,15 @@ class depgraph(object):
                missed_updates = {}
                for pkg, mask_reasons in \
                        self._dynamic_config._runtime_pkg_mask.iteritems():
-                       if mask_reasons.get("slot conflict"):
-                               if pkg.slot_atom in missed_updates:
-                                       other_pkg, parent_atoms = missed_updates[pkg.slot_atom]
-                                       if other_pkg > pkg:
-                                               continue
-                               missed_updates[pkg.slot_atom] = \
-                                       (pkg, mask_reasons["slot conflict"])
-                       elif mask_reasons.get("missing dependency"):
-                               if pkg.slot_atom in missed_updates:
-                                       other_pkg, parent_atoms = missed_updates[pkg.slot_atom]
-                                       if other_pkg > pkg:
-                                               continue
-                               missed_updates[pkg.slot_atom] = \
-                                       (pkg, mask_reasons["missing dependency"])
+                       if pkg.slot_atom in missed_updates:
+                               other_pkg, parent_atoms = missed_updates[pkg.slot_atom]
+                               if other_pkg > pkg:
+                                       continue
+                       for mask_type, parent_atoms in mask_reasons.iteritems():
+                               if not parent_atoms:
+                                       continue
+                               missed_updates[pkg.slot_atom] = (pkg, parent_atoms)
+                               break
 
                if not missed_updates:
                        return