_slot_operator_update_probe: detect insignificant
authorZac Medico <zmedico@gentoo.org>
Mon, 11 Feb 2013 23:43:39 +0000 (15:43 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 11 Feb 2013 23:56:14 +0000 (15:56 -0800)
This avoids rebuilding of two packages due to a sub-slot change in the
child package without revision bump. The sub-slot change is considered
insignificant until one of its parent packages needs to be rebuilt.

pym/_emerge/depgraph.py

index 7423ae0be717b18758edc02d5d2e571ad3ceb7b3..085ac9bb6681d66b7dd4dbc73eb9e2cac31576b3 100644 (file)
@@ -1176,6 +1176,7 @@ class depgraph(object):
                        return None
 
                debug = "--debug" in self._frozen_config.myopts
+               selective = "selective" in self._dynamic_config.myparams
                want_downgrade = None
 
                for replacement_parent in self._iter_similar_available(dep.parent,
@@ -1225,6 +1226,18 @@ class depgraph(object):
                                                        if not want_downgrade:
                                                                continue
 
+                                       insignificant = False
+                                       if selective and \
+                                               dep.parent.installed and \
+                                               dep.child.installed and \
+                                               dep.parent.cpv == replacement_parent.cpv and \
+                                               dep.child.cpv == pkg.cpv:
+                                               # Then can happen if the child's sub-slot changed
+                                               # without a revision bump. The sub-slot change is
+                                               # considered insignificant until one of its parent
+                                               # packages needs to be rebuilt.
+                                               insignificant = True
+
                                        if debug:
                                                msg = []
                                                msg.append("")
@@ -1234,10 +1247,15 @@ class depgraph(object):
                                                msg.append("   existing parent package: %s" % dep.parent)
                                                msg.append("   new child package:  %s" % pkg)
                                                msg.append("   new parent package: %s" % replacement_parent)
+                                               if insignificant:
+                                                       msg.append("insignificant changes detected")
                                                msg.append("")
                                                writemsg_level("\n".join(msg),
                                                        noiselevel=-1, level=logging.DEBUG)
 
+                                       if insignificant:
+                                               return None
+
                                        return pkg
 
                if debug: