diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-08-16 06:39:55 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-08-16 06:39:55 +0000 |
commit | 563d3a0c4f08e7f9c485e8b776350e0fd62f238b (patch) | |
tree | 8c1b2ada05e7c8709e1913cf8c3f31b4b5c7b830 /bin | |
parent | adf04b5570ce1bee40405b90fc739228b1044a02 (diff) | |
download | portage-563d3a0c4f08e7f9c485e8b776350e0fd62f238b.tar.gz portage-563d3a0c4f08e7f9c485e8b776350e0fd62f238b.tar.bz2 portage-563d3a0c4f08e7f9c485e8b776350e0fd62f238b.zip |
Combine 2 locations in depgraph.create() where nodes are added to the digraph. This ensures that dependencies on "rebuild" nodes always have their priority increased. (trunk r7626:7628)
svn path=/main/branches/2.1.2/; revision=7629
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/emerge | 60 |
1 files changed, 25 insertions, 35 deletions
diff --git a/bin/emerge b/bin/emerge index 4282dc897..f9d381297 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1245,6 +1245,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": @@ -1288,22 +1293,6 @@ class depgraph: return 0 del e - 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() @@ -1355,6 +1344,19 @@ class depgraph: mydbapi.aux_get(mykey, self._mydbapi_keys))) myuse = metadata["USE"].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 @@ -1362,16 +1364,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. @@ -1404,19 +1407,6 @@ 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) |