]> Savannah Git Hosting - gnulib.git/commitdiff
gitlog-to-changelog: Recommend more reliable Makefile rule idiom.
authorBruno Haible <bruno@clisp.org>
Fri, 10 Jan 2025 11:57:01 +0000 (12:57 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 10 Jan 2025 11:57:01 +0000 (12:57 +0100)
Reported by Basil L. Contovounesios <basil@contovou.net>.

* doc/gitlog-to-changelog.texi: Make the gen-ChangeLog rule fail if the
ChangeLog file cannot be created or if the disk is full. Drop the use of
an intermediate file, not needed under $(distdir).

ChangeLog
doc/gitlog-to-changelog.texi

index e08bd02293016f186807e7ba1ba2d43fe81397eb..f56e8d02ba882a0912e152399673c5e11ff6f01e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-01-10  Bruno Haible  <bruno@clisp.org>
+
+       gitlog-to-changelog: Recommend more reliable Makefile rule idiom.
+       Reported by Basil L. Contovounesios <basil@contovou.net>.
+       * doc/gitlog-to-changelog.texi: Make the gen-ChangeLog rule fail if the
+       ChangeLog file cannot be created or if the disk is full. Drop the use of
+       an intermediate file, not needed under $(distdir).
+
 2025-01-10  Bruno Haible  <bruno@clisp.org>
 
        doc: Fix syntax errors (regression yesterday).
index c58d59d8d23a4e42bc713737256c0264da46bfc2..9b65da9b288eb5393609289670bd4655f2f50ad8 100644 (file)
@@ -32,8 +32,8 @@ gen-ChangeLog:
         $(AM_V_GEN)if test -e $(srcdir)/.git; then             \
           LC_ALL=en_US.UTF-8 TZ=UTC0                           \
             $(top_srcdir)/build-aux/gitlog-to-changelog        \
-              --srcdir=$(srcdir) > $(distdir)/ChangeLog.tmp && \
-          mv -f $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
+              --srcdir=$(srcdir) > $(distdir)/ChangeLog        \
+          || exit 1;                                           \
         fi
 @end example
 
@@ -55,8 +55,8 @@ gen-ChangeLog:
         $(AM_V_GEN)if test -e $(srcdir)/.git; then             \
           $(top_srcdir)/build-aux/gitlog-to-changelog          \
               --srcdir=$(srcdir) --commit-timezone             \
-              > $(distdir)/ChangeLog.tmp &&                    \
-          mv -f $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
+              > $(distdir)/ChangeLog                           \
+          || exit 1;                                           \
         fi
 @end example
 
@@ -100,7 +100,7 @@ gen-ChangeLog:
                 --srcdir=$(srcdir)                                 \
                 "$$amend_git_log" -- 'v$(gen_start_ver)~..' &&     \
             printf '\n\nSee the source repo for older entries.\n'; \
-          @} > $(distdir)/ChangeLog.tmp &&                          \
-          mv -f $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog;     \
+          @} > $(distdir)/ChangeLog                                 \
+          || exit 1;                                               \
         fi
 @end example