diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-02-14 21:33:58 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-02-14 21:33:58 +0000 |
commit | 6c54b8b0d6d12f40f5172f573d7d030eafeaa9b0 (patch) | |
tree | 862960275c8810369977d09019f343d2a12ffb01 | |
parent | 17a1514896d582e4bcb74007ea76f436dd1ca76c (diff) | |
download | portage-6c54b8b0d6d12f40f5172f573d7d030eafeaa9b0.tar.gz portage-6c54b8b0d6d12f40f5172f573d7d030eafeaa9b0.tar.bz2 portage-6c54b8b0d6d12f40f5172f573d7d030eafeaa9b0.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.
svn path=/main/trunk/; revision=12611
-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 0ad8c1b02..e9280abac 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6941,10 +6941,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 |