Skip to content

Commit

Permalink
docs/Makefile.am, .gitignore: use unique temporary filenames in $(NUT…
Browse files Browse the repository at this point in the history
…_SPELL_DICT).usage-report, ChangeLog.adoc and .adoc.adoc-parsed rules to avoid surprises

TODO: Look at why we might call generation of ChangeLog.adoc
several times simultaneously and the make job server would
not prevent that?

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
  • Loading branch information
jimklimov committed May 16, 2024
1 parent 2f8ba40 commit c8d7e3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ Makefile.in
*.usage-report
*.adoc-parsed
*.adoc*.tmp
*.adoc*.tmp.*
*.txt*.tmp
*.txt*.tmp.*
/cppcheck*.xml
/.ci*.txt*
/.ci*.log
Expand Down
15 changes: 8 additions & 7 deletions docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ DOCBUILD_FILTER_GITHUB_LINKS = { \
# The $< is okay here, it is used in a suffix rule below
DOCBUILD_CONVERT_GITHUB_LINKS = { \
echo " DOC-ASCIIDOC-GITHUB-LINKS Parsing GitHub link patterns $< => $@"; \
cat "$<" | $(DOCBUILD_FILTER_GITHUB_LINKS) > "$@.tmp" \
&& mv -f "$@.tmp" "$@" \
cat "$<" | $(DOCBUILD_FILTER_GITHUB_LINKS) > "$@.tmp.$$$$" \
&& mv -f "$@.tmp.$$$$" "$@" \
; }

.adoc.adoc-parsed:
Expand Down Expand Up @@ -278,7 +278,7 @@ $(top_builddir)/ChangeLog.adoc: $(top_builddir)/ChangeLog
exit ; \
} ; \
echo " DOC-CHANGELOG-ASCIIDOC $${INPUT} => $@" \
&& printf "ifdef::txt[]\n== Very detailed Change Log\n"$(A2X_ASCII_IDS)"endif::txt[]\n\n" > "$@.tmp" \
&& printf "ifdef::txt[]\n== Very detailed Change Log\n"$(A2X_ASCII_IDS)"endif::txt[]\n\n" > "$@.tmp.$$$$" \
&& TABCHAR="`printf '\t'`" \
&& $(SED) \
-e 's,^\([0-9a-zA-Z]\),=== \1,' \
Expand All @@ -289,8 +289,8 @@ $(top_builddir)/ChangeLog.adoc: $(top_builddir)/ChangeLog
-e 's,^\([ '"$${TABCHAR}"'].*\)\([~|^]\),\1\\\2,g' \
-e 's,\[\[\([^]]*\)\]\],[\1],g' \
-e 's,^\(\s\s*\)\([0-9]\),\1{empty}\2,g' \
< "$${INPUT}" >> "$@.tmp" \
&& mv -f "$@.tmp" "$@"
< "$${INPUT}" >> "$@.tmp.$$$$" \
&& mv -f "$@.tmp.$$$$" "$@"

# Add other directory deps (not for local EXTRA_DIST) and generated contents
FULL_USER_MANUAL_DEPS = $(USER_MANUAL_DEPS) $(SHARED_DEPS) \
Expand Down Expand Up @@ -666,8 +666,9 @@ $(NUT_SPELL_DICT).usage-report: $(NUT_SPELL_DICT)
if [ "$$HITC_CI" != 0 ] ; then echo "$$HITS_CI" ; echo "^^^"; fi; \
fi; \
); \
done > "$@.tmp"
test -f "$@.tmp" && mv -f "$@.tmp" "$@"
done > "$@.tmp.$$$$" \
&& test -f "$@.tmp.$$$$" \
&& mv -f "$@.tmp.$$$$" "$@"
@echo "Reporting words from $? possibly not used in current inspected code base revision under $(abs_top_srcdir)" >&2 ; \
grep -E '^--- ' < "$@" | grep '(0 ' || echo "SUCCESS: None found"

Expand Down

0 comments on commit c8d7e3c

Please sign in to comment.