Skip to content

Commit

Permalink
Makefile.am: update ChangeLog recipe to log messages about its work/s…
Browse files Browse the repository at this point in the history
…kip/fail decisions [networkupstools/nut-website#52]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed May 10, 2024
1 parent 9a06cc8 commit d0ce977
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,27 @@ $(abs_top_builddir)/ChangeLog: tools/gitlog2changelog.py dummy-stamp
if test -e .git ; then \
NUT_GITDIR=".git" ; if test -r "$${NUT_GITDIR}" -a ! -d "$${NUT_GITDIR}" ; then GD="`grep -E '^gitdir:' "$${NUT_GITDIR}" | sed 's/^gitdir: *//'`" && test -n "$$GD" -a -d "$$GD" && NUT_GITDIR="$$GD" ; fi ; \
if test -s "$@" -a -d "$${NUT_GITDIR}" -a -z "`find "$${NUT_GITDIR}" -newer "$@"`" 2>/dev/null ; then \
echo " DOC-CHANGELOG-GENERATE $@ : SKIP (keep existing)" ; \
echo "Using still-valid ChangeLog file generated earlier from same revision of Git source metadata in '$${NUT_GITDIR}'" >&2 ; \
else \
CHANGELOG_FILE="$@" $(WITH_PDF_NONASCII_TITLES_ENVVAR) $(abs_top_builddir)/tools/gitlog2changelog.py $(GITLOG_START_POINT) || \
{ printf "gitlog2changelog.py failed to generate the ChangeLog.\n\nNOTE: See https://github.com/networkupstools/nut/commits/master for change history.\n\n" > "$@" ; } ; \
echo " DOC-CHANGELOG-GENERATE $@" ; \
CHANGELOG_FILE="$@" $(WITH_PDF_NONASCII_TITLES_ENVVAR) $(abs_top_builddir)/tools/gitlog2changelog.py $(GITLOG_START_POINT) || { \
echo " DOC-CHANGELOG-GENERATE $@ : FAILED (non-fatal)" >&2 ; \
printf "gitlog2changelog.py failed to generate the ChangeLog.\n\nNOTE: See https://github.com/networkupstools/nut/commits/master for change history.\n\n" > "$@" ; \
} ; \
fi ; \
else \
if test x"$(abs_top_srcdir)" != x"$(abs_top_builddir)" -a -s ./ChangeLog ; then \
echo " DOC-CHANGELOG-GENERATE $@ : SKIP (keep existing)" ; \
echo "Using distributed ChangeLog file from sources" >&2 ; \
rm -f "$@" || true ; \
cat ./ChangeLog > "$@" ; \
else \
if ! test -s "$@" ; then \
if test -s "$@" ; then \
echo " DOC-CHANGELOG-GENERATE $@ : SKIP (keep existing)" ; \
echo "Using distributed ChangeLog file from sources" >&2 ; \
else \
echo " DOC-CHANGELOG-GENERATE $@ : FAILED (non-fatal)" >&2 ; \
printf "Failed to generate the ChangeLog.\n\nNOTE: See https://github.com/networkupstools/nut/commits/master for change history.\n\n" > "$@" ; \
fi ; \
fi ; \
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ DOCBUILD_CONVERT_GITHUB_LINKS = { \
@$(DOCBUILD_CONVERT_GITHUB_LINKS)

$(top_builddir)/ChangeLog:
+@echo " DOC-CHANGELOG-GENERATE $@" \
+@echo " DOC-CHANGELOG-GENERATE $@ : call parent Makefile" \
&& cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) $(@F)

# BSD Make dislikes the path resolution here and does not always populate "$<"
Expand Down

0 comments on commit d0ce977

Please sign in to comment.