From a4cad6c46f6aa40f9a1683259407485d1dc82c13 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 15 Jul 2008 08:28:16 +0000 Subject: [PATCH] * Fix --keep-going breakage that occured when Scheduler._choose_pkg() was introduced. * Handle multiple failed builds when buildinding in parallel. * Fix Scheduler._do_merge_exit() to remove the correct package since it's not always at position 0 when using --jobs. in parallel, so svn path=/main/trunk/; revision=11054 --- pym/_emerge/__init__.py | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 45c958aed..7fd2c2764 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -8792,6 +8792,7 @@ class Scheduler(PollScheduler): keep_going = "--keep-going" in self.myopts mtimedb = self._mtimedb + failed_pkgs = self._failed_pkgs while True: rval = self._merge() @@ -8805,19 +8806,15 @@ class Scheduler(PollScheduler): mergelist = self._mtimedb["resume"].get("mergelist") if not mergelist: break - if mergelist[0][-1] != "merge": - break - # Skip the first one because it failed to build or install. - pkg_key = tuple(mergelist[0]) - del mergelist[0] - failed_pkg = None - for task in self._mergelist: - if task == pkg_key: - failed_pkg = task - break - if failed_pkg is None: + if not failed_pkgs: break + + for failed_pkg, returncode in failed_pkgs: + mergelist.remove(list(failed_pkg)) + + del failed_pkgs[:] + if not mergelist: break @@ -8887,7 +8884,7 @@ class Scheduler(PollScheduler): # --resume still works after being interrupted # by reboot, sigkill or similar. mtimedb = self._mtimedb - del mtimedb["resume"]["mergelist"][0] + mtimedb["resume"]["mergelist"].remove(list(pkg)) if not mtimedb["resume"]["mergelist"]: del mtimedb["resume"] mtimedb.commit() @@ -8924,8 +8921,6 @@ class Scheduler(PollScheduler): if failed_pkgs: pkg, rval = failed_pkgs[-1] - del failed_pkgs[:] - return rval def _main_loop_cleanup(self): @@ -11351,9 +11346,8 @@ def resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner, # will be infinite. Therefore, if that case ever # occurs for some reason, raise the exception to # break out of the loop. - if not pruned_mergelist or \ - len(pruned_mergelist) == len(mergelist): - raise + if len(pruned_mergelist) == len(mergelist): + raise AssertionError("tight loop") mergelist[:] = pruned_mergelist dropped_tasks.update(unsatisfied_parents) del e, graph, traversed_nodes, \ -- 2.26.2