Add debug output for cases like bug #453400.
authorZac Medico <zmedico@gentoo.org>
Thu, 24 Jan 2013 01:18:10 +0000 (17:18 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 24 Jan 2013 01:18:10 +0000 (17:18 -0800)
pym/_emerge/resolver/slot_collision.py

index f07b01a44409f6c0cc580ac4e39f3dde226d35de..f8e1e4ecd2c859d28a0b033c7a577f7e192fcd5b 100644 (file)
@@ -317,6 +317,26 @@ class slot_conflict_handler(object):
                                                                        #Use conditionals not met.
                                                                        violated_atom = atom.violated_conditionals(_pkg_use_enabled(other_pkg), \
                                                                                other_pkg.iuse.is_valid_flag)
+                                                                       if violated_atom.use is None:
+                                                                               # Something like bug #453400 caused the
+                                                                               # above findAtomForPackage call to
+                                                                               # to return None unexpectedly.
+                                                                               msg = ("\n\n!!! BUG: Detected "
+                                                                                       "USE dep match inconsistency:\n"
+                                                                                       "\tppkg: %s\n"
+                                                                                       "\tviolated_atom: %s\n"
+                                                                                       "\tatom: %s unevaluated: %s\n"
+                                                                                       "\tother_pkg: %s IUSE: %s USE: %s\n" %
+                                                                                       (ppkg,
+                                                                                       violated_atom,
+                                                                                       atom,
+                                                                                       atom.unevaluated_atom,
+                                                                                       other_pkg,
+                                                                                       sorted(other_pkg.iuse.all),
+                                                                                       sorted(_pkg_use_enabled(other_pkg))))
+                                                                               writemsg(msg, noiselevel=-2)
+                                                                               raise AssertionError(
+                                                                                       'BUG: USE dep match inconsistency')
                                                                        for flag in violated_atom.use.enabled.union(violated_atom.use.disabled):
                                                                                atoms = collision_reasons.get(("use", flag), set())
                                                                                atoms.add((ppkg, atom, other_pkg))