Always assign higher priority to dependencies on packages that are being rebuilt...
authorZac Medico <zmedico@gentoo.org>
Thu, 16 Aug 2007 05:02:38 +0000 (05:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 16 Aug 2007 05:02:38 +0000 (05:02 -0000)
svn path=/main/branches/2.1.2/; revision=7626

bin/emerge

index 3207793a84a85ec181846589593b8fb54a2907a8..4282dc897713e3664f7ece32ca049c714ceca599 100755 (executable)
@@ -1288,17 +1288,6 @@ class depgraph:
                                        return 0
                                del e
 
-               # normal arg, not system or world
-               if arg and len(self._sets) == 1 and \
-                       "selective" not in self.myparams:
-                       # For revdep-rebuild, dependencies on packages specified as
-                       # arguments are given higher priority since the currently
-                       # installed version has been rendered useless by ABI breakage.
-                       # It's okay to increase the priority here even if the caller
-                       # is not revdep-rebuild.
-                       if priority.satisfied:
-                               priority.rebuild = True
-
                existing_node = None
                if addme:
                        existing_node = self.pkg_node_map[myroot].get(mykey)
@@ -1415,6 +1404,19 @@ class depgraph:
                                if reinstall_for_flags:
                                        self._reinstall_nodes[jbigkey] = reinstall_for_flags
 
+                       if merging and \
+                               "empty" not in self.myparams and \
+                               vardbapi.match(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
+
                        if rev_dep and myparent:
                                self.digraph.addnode(myparent, jbigkey,
                                        priority=priority)