keep_going = "--keep-going" in self.myopts
mtimedb = self._mtimedb
+ failed_pkgs = self._failed_pkgs
while True:
rval = self._merge()
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
# --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()
if failed_pkgs:
pkg, rval = failed_pkgs[-1]
- del failed_pkgs[:]
-
return rval
def _main_loop_cleanup(self):
# 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, \