groff-commit
[Top][All Lists]
Advanced

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

[groff] 17/19: Makefile.am: Add set-man-page-time-stamps target.


From: G. Branden Robinson
Subject: [groff] 17/19: Makefile.am: Add set-man-page-time-stamps target.
Date: Sun, 22 Sep 2024 00:33:07 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 09ea0a488cd0a756f8decbe2fb133567d3ff7e96
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Sep 21 22:58:45 2024 -0500

    Makefile.am: Add set-man-page-time-stamps target.
    
    * Makefile.am (set-man-page-time-stamps): New maintainer-mode rule sets
      time stamps of man page source documents to match the Git "author
      date" of their most recent commits.  This is to make the date reported
      in the center footer of the rendered page tell the truth.
---
 ChangeLog   |  8 ++++++++
 Makefile.am | 18 ++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 036fd1e8d..506645372 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-09-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * Makefile.am (set-man-page-time-stamps): New maintainer-mode
+       rule sets time stamps of man page source documents to match the
+       Git "author date" of their most recent commits.  This is to make
+       the date reported in the center footer of the rendered page tell
+       the truth.
+
 2024-09-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/utils/afmtodit/afmtodit.tables: Update using the Unicode
diff --git a/Makefile.am b/Makefile.am
index 83be99c08..412158b27 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -790,6 +790,24 @@ MOSTLYCLEANFILES += $(prefixexecbin_SCRIPTS) 
$(bin_SCRIPTS) \
   $(man1_MANS) $(man5_MANS) $(man7_MANS) \
   $(PREFIXMAN1)
 
+# Maintainer-mode rule to set man page time stamps to date of last
+# Git commit thereto (rebasing can screw up their mtimes).
+.PHONY: set-man-page-time-stamps
+set-man-page-time-stamps:
+       for f in $(man1_MANS) $(man5_MANS) $(man7_MANS); do \
+         g=$(top_srcdir)/$$f.man; \
+         if [ -f $$g ]; then \
+           h=$$g.in; \
+           if [ -f $$h ]; then \
+             page=$$h; \
+           else \
+             page=$$g; \
+           fi; \
+         fi; \
+         ts=`git log -1 --pretty="format:%aI" $$page`; \
+         touch -d $$ts $$page; \
+       done
+
 # Suffix rule to build .1, .5 and .7 files from .1.man, .5.man and
 # .7.man files.  The brackets around the @ are used to prevent the
 # substitution of the variable by Automake.



reply via email to

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