DepPriority: remove "rebuild" attribute
authorZac Medico <zmedico@gentoo.org>
Sun, 22 May 2011 00:46:11 +0000 (17:46 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 22 May 2011 00:46:11 +0000 (17:46 -0700)
Since the addition of DepPriorityNormalRange and
DepPrioritySatisfiedRange in commit
bd369956b2a2fbc019a655a372628998499156c0, which solves most cases of
bug 199856, the Depriority.rebuild attribute doesn't appear to make any
difference. The edges that this attribute differentiates are already
naturally differentiated by the fact that the child node of a satisfied
buildtime dependency that's not being rebuilt will naturally be
identified as a leaf node earlier and removed from the graph, thereby
eliminating the edge before there's an opportunity to compare it with
a higher priority rebuild edge. The addition of the "optional"
attribute (in commit 15476805a156acd11fdaaa19212691e8ee09b309) also
plays a role here, since it converts some satisfied buildtime edges to
optional edges, thereby reducing their priority.

pym/_emerge/DepPriority.py
pym/_emerge/DepPrioritySatisfiedRange.py
pym/_emerge/depgraph.py

index 252a81e822974050f62754c90142dda01b174361..3c2256a8e7bf592a913c85a14373324af9547339 100644 (file)
@@ -4,7 +4,7 @@
 from _emerge.AbstractDepPriority import AbstractDepPriority
 class DepPriority(AbstractDepPriority):
 
-       __slots__ = ("satisfied", "optional", "rebuild", "ignored")
+       __slots__ = ("satisfied", "optional", "ignored")
 
        def __int__(self):
                """
index 7fa2f09778c1923a9de8bd0338388ce8c9358e43..edb29df96eecc98c92b5bc5822906cd17a0dfa70 100644 (file)
@@ -7,18 +7,17 @@ class DepPrioritySatisfiedRange(object):
        DepPriority                         Index      Category
 
        not satisfied and buildtime                    HARD
-       not satisfied and runtime              7       MEDIUM
-       not satisfied and runtime_post         6       MEDIUM_SOFT
-       satisfied and buildtime and rebuild    5       SOFT
+       not satisfied and runtime              6       MEDIUM
+       not satisfied and runtime_post         5       MEDIUM_SOFT
        satisfied and buildtime                4       SOFT
        satisfied and runtime                  3       SOFT
        satisfied and runtime_post             2       SOFT
        optional                               1       SOFT
        (none of the above)                    0       NONE
        """
-       MEDIUM      = 7
-       MEDIUM_SOFT = 6
-       SOFT        = 5
+       MEDIUM      = 6
+       MEDIUM_SOFT = 5
+       SOFT        = 4
        NONE        = 0
 
        @classmethod
@@ -51,21 +50,8 @@ class DepPrioritySatisfiedRange(object):
        def _ignore_satisfied_buildtime(cls, priority):
                if priority.__class__ is not DepPriority:
                        return False
-               if priority.optional:
-                       return True
-               if not priority.satisfied:
-                       return False
-               if priority.buildtime:
-                       return not priority.rebuild
-               return True
-
-       @classmethod
-       def _ignore_satisfied_buildtime_rebuild(cls, priority):
-               if priority.__class__ is not DepPriority:
-                       return False
-               if priority.optional:
-                       return True
-               return bool(priority.satisfied)
+               return bool(priority.optional or \
+                       priority.satisfied)
 
        @classmethod
        def _ignore_runtime_post(cls, priority):
@@ -85,7 +71,7 @@ class DepPrioritySatisfiedRange(object):
 
        ignore_medium      = _ignore_runtime
        ignore_medium_soft = _ignore_runtime_post
-       ignore_soft        = _ignore_satisfied_buildtime_rebuild
+       ignore_soft        = _ignore_satisfied_buildtime
 
 
 DepPrioritySatisfiedRange.ignore_priority = (
@@ -94,7 +80,6 @@ DepPrioritySatisfiedRange.ignore_priority = (
        DepPrioritySatisfiedRange._ignore_satisfied_runtime_post,
        DepPrioritySatisfiedRange._ignore_satisfied_runtime,
        DepPrioritySatisfiedRange._ignore_satisfied_buildtime,
-       DepPrioritySatisfiedRange._ignore_satisfied_buildtime_rebuild,
        DepPrioritySatisfiedRange._ignore_runtime_post,
        DepPrioritySatisfiedRange._ignore_runtime
 )
index 3ef47f8abf380f1cd0af0a1becb9e5e6e67364fb..d09ee87ba19c80fd511c346121d997b17b6b730c 100644 (file)
@@ -1036,18 +1036,6 @@ class depgraph(object):
                                return 0
 
                if not pkg.onlydeps:
-                       if not pkg.installed and \
-                               "empty" not in self._dynamic_config.myparams and \
-                               vardbapi.match(pkg.slot_atom):
-                               # Increase the priority of dependencies on packages that
-                               # are being rebuilt. This optimizes merge order so that
-                               # dependencies are rebuilt/updated as soon as possible,
-                               # which is needed especially when emerge is called by
-                               # revdep-rebuild since dependencies may be affected by ABI
-                               # breakage that has rendered them useless. Don't adjust
-                               # priority here when in "empty" mode since all packages
-                               # are being merged in that case.
-                               priority.rebuild = True
 
                        existing_node, existing_node_matches = \
                                self._check_slot_conflict(pkg, dep.atom)