diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-11 05:12:20 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-11 05:12:20 +0000 |
commit | 477acfef3a67980a79a04cce947d0025bc152ae8 (patch) | |
tree | 734b0457e5211b0c600dfa5bc654aa385461fc4f /pym | |
parent | e21a364874b908e9f1e6e4cbdfbadba62bac2f2a (diff) | |
download | portage-477acfef3a67980a79a04cce947d0025bc152ae8.tar.gz portage-477acfef3a67980a79a04cce947d0025bc152ae8.tar.bz2 portage-477acfef3a67980a79a04cce947d0025bc152ae8.zip |
In depgraph._serialize_tasks(), when appropriate, execute uninstall tasks
sooner. This solves some cases of bug #256870 since there is a smaller window
of time for some other failure to cause the uninstall to get discarded.
(trunk r12611)
svn path=/main/branches/2.1.6/; revision=12889
Diffstat (limited to 'pym')
-rw-r--r-- | pym/_emerge/__init__.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 0d94025bd..9ff89d523 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6925,10 +6925,21 @@ class depgraph(object): # and we want to avoid executing a separate uninstall # task in that case. if len(nodes) > 1: - non_uninstalls = [node for node in nodes \ - if node.operation != "uninstall"] - if non_uninstalls: - nodes = non_uninstalls + good_uninstalls = [] + with_some_uninstalls_excluded = [] + for node in nodes: + if node.operation == "uninstall": + slot_node = self.mydbapi[node.root + ].match_pkgs(node.slot_atom) + if slot_node and \ + slot_node[0].operation == "merge": + continue + good_uninstalls.append(node) + with_some_uninstalls_excluded.append(node) + if good_uninstalls: + nodes = good_uninstalls + elif with_some_uninstalls_excluded: + nodes = with_some_uninstalls_excluded else: nodes = nodes |