Skip to content

Commit

Permalink
Mark all outputs as done, not just target
Browse files Browse the repository at this point in the history
Avoids duplicate work in certain situations (with -b, but possible also in
others?).
  • Loading branch information
texttheater committed Feb 24, 2021
1 parent e438f76 commit 7c33480
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion produce
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,13 @@ class Production:
neutral_targets, pretend_up_to_date)
self.set_result(target, result)
debug(3, 'created result for {}: {}'.format(target, repr(result)))
# Step 7: mark other outputs as done
for output in outputs:
if output == target:
continue
output_result = ProductionResult(True, mtime(output))
self.set_result(output, output_result)
debug(3, 'created result for {}: {}'.format(output, repr(output_result)))
return result
except BaseException as e:
self.set_result(target, e)
Expand Down Expand Up @@ -865,7 +872,7 @@ class Production:
debug(3, 'started subprocess')
while True:
try:
debug(3, 'waiting')
debug(5, 'waiting')
proc.wait(0.05)
except subprocess.TimeoutExpired:
pass
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = produce
version = 0.4.1
version = 0.4.2
author = Kilian Evang
author_email = kilian.evang@gmail.com
url = https://github.com/texttheater/produce
Expand Down

0 comments on commit 7c33480

Please sign in to comment.