Skip to content

Commit

Permalink
make hack/markdown-preprocess parallel-safe
Browse files Browse the repository at this point in the history
One of the tmpfiles was not uniquely named, resulting in
conflicts with parallel 'make docs'. Fix that.

A better solution would be to run only one instance of the
preprocess script, but the Makefile incantation for that
is beyond me. This approach is CPU-wasteful but good enough.

Fixes: containers#17322

Signed-off-by: Ed Santiago <santiago@redhat.com>
  • Loading branch information
edsantiago authored and arixmkii committed Feb 6, 2023
1 parent 51dd01c commit 162e596
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hack/markdown-preprocess
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Preprocessor():
cross-referencing all the man pages in which they're used.
"""
for optionfile in self.used_by:
tmpfile = optionfile + '.tmp'
tmpfile = optionfile + '.tmp.' + str(os.getpid())
with open(optionfile, 'r', encoding='utf-8') as fh_in, open(tmpfile, 'w', encoding='utf-8', newline='\n') as fh_out:
fh_out.write("####> This option file is used in:\n")
used_by = ', '.join(x for x in self.used_by[optionfile])
Expand Down

0 comments on commit 162e596

Please sign in to comment.