From: Zac Medico Date: Thu, 16 Aug 2007 07:27:51 +0000 (-0000) Subject: Always assign higher priority to dependencies on packages that are being rebuilt... X-Git-Tag: v2.1.2.12~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=542291caf8de39c1a4d6d3c5b1fbd5d67321d6ed;p=portage.git Always assign higher priority to dependencies on packages that are being rebuilt (except when --emptytree is enabled since all packages are merged in that case). This optimizes merge order so that dependencies are rebuilt/updated as soon as possible. (branches/2.1.2 r7625:7629) svn path=/main/branches/2.1.2.9/; revision=7630 --- diff --git a/bin/emerge b/bin/emerge index 2d286d6d6..0f8a6f296 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1066,6 +1066,11 @@ class depgraph: #IUSE-aware emerge -> USE DEP aware depgraph #"no downgrade" emerge """ + + # unused parameters + rev_dep = False + myuse = None + mytype, myroot, mykey = mybigkey if mytype == "blocks": @@ -1097,32 +1102,6 @@ class depgraph: self.pkgsettings[myroot].setcpv(mykey, mydb=portdb) myuse = self.pkgsettings[myroot]["USE"].split() - # normal arg, not system or world - if arg 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) - if existing_node: - self._parent_child_digraph.add(existing_node, myparent) - if existing_node != myparent: - # Refuse to make a node depend on itself so that the we don't - # don't create a bogus circular dependency in self.altlist(). - if rev_dep and myparent: - self.digraph.addnode(myparent, existing_node, - priority=priority) - else: - self.digraph.addnode(existing_node, myparent, - priority=priority) - return 1 - if "--nodeps" not in self.myopts: self.spinner.update() @@ -1174,6 +1153,19 @@ class depgraph: mydbapi.aux_get(mykey, self._mydbapi_keys))) myuse = mydbapi.aux_get(mykey, ["USE"])[0].split() slot_atom = "%s:%s" % (portage.dep_getkey(mykey), metadata["SLOT"]) + 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 + existing_node = self._slot_node_map[myroot].get( slot_atom, None) slot_collision = False @@ -1181,16 +1173,17 @@ class depgraph: e_type, myroot, e_cpv, e_status = existing_node if mykey == e_cpv: # The existing node can be reused. - self._parent_child_digraph.add(existing_node, myparent) - if rev_dep and myparent: - ptype, proot, pkey, pstatus = myparent - self.digraph.addnode(myparent, existing_node, - priority=priority) - else: + if existing_node != myparent: + # Refuse to make a node depend on itself so that + # we don't create a bogus circular dependency + # in self.altlist(). + self._parent_child_digraph.add(existing_node, myparent) self.digraph.addnode(existing_node, myparent, priority=priority) return 1 else: + if jbigkey in self._slot_collision_nodes: + return 1 # A slot collision has occurred. Sometimes this coincides # with unresolvable blockers, so the slot collision will be # shown later if there are no unresolvable blockers.