Old "Change USE" message: Don't screw up if the highest version is masked and parent...
authorSebastian Luther <SebastianLuther@gmx.de>
Fri, 3 Sep 2010 20:23:11 +0000 (22:23 +0200)
committerZac Medico <zmedico@gentoo.org>
Fri, 3 Sep 2010 20:32:12 +0000 (13:32 -0700)
pym/_emerge/depgraph.py

index a51bd7facf984727908e1170d1f96e4fb3f4763f..12f12d4723b4637a335e115f673a22366059f410 100644 (file)
@@ -2204,14 +2204,24 @@ class depgraph(object):
                show_missing_use = False
                if unmasked_use_reasons:
                        # Only show the latest version.
-                       show_missing_use = unmasked_use_reasons[:1]
+                       show_missing_use = []
+                       pkg_reason = None
+                       parent_reason = None
                        for pkg, mreasons in unmasked_use_reasons:
-                               if myparent and pkg == myparent:
-                                       #This happens if a use change on the parent
-                                       #leads to a satisfied conditional use dep.
-                                       show_missing_use.append((pkg, mreasons))
-                                       break
-                               
+                               if pkg is myparent:
+                                       if parent_reason is None:
+                                               #This happens if a use change on the parent
+                                               #leads to a satisfied conditional use dep.
+                                               parent_reason = (pkg, mreasons)
+                               elif pkg_reason is None:
+                                       #Don't rely on the first pkg in unmasked_use_reasons,
+                                       #being the highest version of the dependency.
+                                       pkg_reason = (pkg, mreasons)
+                       if pkg_reason:
+                               show_missing_use.append(pkg_reason)
+                       if parent_reason:
+                               show_missing_use.append(parent_reason)
+
                elif unmasked_iuse_reasons:
                        masked_with_iuse = False
                        for pkg in masked_pkg_instances: