groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 03/16: Update .version file more aggressively.


From: G. Branden Robinson
Subject: [groff] 03/16: Update .version file more aggressively.
Date: Mon, 23 Aug 2021 00:06:39 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit c1bb33e5beec25b4059bca3cc4529b738ec486c7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Aug 21 11:09:38 2021 +1000

    Update .version file more aggressively.
    
    * Makefile.am: Regenerate a temporary version string file on every
      build, but update the real version file's mtime only if its contents
      change.
    
      (.version.tree): New target.  Mark it phony, populating it with
      `$(VERSION)` with every `make` if the `.tarball-version` file {created
      by `dist-hook`} doesn't exist.
    
      ($(top_srcdir)/.version): Depend on foregoing target.  If the tarball
      version file and the target do not exist, copy `.tree` file into
      place.  Compare this file with `.tree` file; if they differ, move the
      `.tree` file to this one.
    
      (MOSTLYCLEANFILES): Add `.version.tree`.
    
    Fixes <https://savannah.gnu.org/bugs/?61052>.  Thanks to Bjarni Ingi
    Gislason for the report.
---
 ChangeLog   | 19 +++++++++++++++++++
 Makefile.am | 13 +++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d2633f4..318e994 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2021-08-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       Update .version file more aggressively.
+
+       * Makefile.am: Regenerate a temporary version string file on
+       every build, but update the real version file's mtime only if
+       its contents change.
+       (.version.tree): New target.  Mark it phony, populating it with
+       `$(VERSION)` with every `make` if the `.tarball-version` file
+       {created by `dist-hook`} doesn't exist.
+       ($(top_srcdir)/.version): Depend on foregoing target.  If the
+       tarball version file and the target do not exist, copy `.tree`
+       file into place.  Compare this file with `.tree` file; if they
+       differ, move the `.tree` file to this one.
+       (MOSTLYCLEANFILES): Add `.version.tree`.
+
+       Fixes <https://savannah.gnu.org/bugs/?61052>.  Thanks to Bjarni
+       Ingi Gislason for the report.
+
+2021-08-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        [libgroff]: Rename font class member variable.
 
        * src/include/font.h (font class): Rename `unscaled_charwidths`
diff --git a/Makefile.am b/Makefile.am
index a6b016d..5303dae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -922,8 +922,17 @@ SUFFIXES += .man
 # Version files - see script 'build-aux/git-gen-version'
 EXTRA_DIST += $(top_srcdir)/.version
 BUILT_SOURCES += $(top_srcdir)/.version
-$(top_srcdir)/.version:
-       echo $(VERSION) > $@-t && mv $@-t $@
+# Regenerate a temporary version string file on every build, but update
+# the real version file's mtime only if its contents change.
+.PHONY: .version.tree
+.version.tree:
+       @test -f $(distdir)/.tarball-verion || echo $(VERSION) > $@
+$(top_srcdir)/.version: .version.tree
+       @if ! test -f $(distdir)/.tarball-version; then \
+         test -f $@ || cp .version.tree $@; \
+         cmp -s .version.tree $@ || cp .version.tree $@; \
+       fi
+MOSTLYCLEANFILES += .version.tree
 dist-hook:
        echo $(VERSION) > $(distdir)/.tarball-version
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]