]> Savannah Git Hosting - gnulib.git/commitdiff
maint: use UTC when updating copyright date
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 Jan 2023 02:40:56 +0000 (18:40 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 Jan 2023 02:43:02 +0000 (18:43 -0800)
Problem reported by Simon Joseffson in:
https://lists.gnu.org/r/bug-gnulib/2022-12/msg00125.html
* Makefile (COPYRIGHT_TZ): New macro.
(update-copyright): Use it.

ChangeLog
Makefile

index ef7f457143d59816614fc0203e8494d5b3d14039..8ef7d0c26aed0e193825e012680ae66b9b4fc4a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-12-31  Paul Eggert  <eggert@cs.ucla.edu>
+
+       maint: use UTC when updating copyright date
+       Problem reported by Simon Joseffson in:
+       https://lists.gnu.org/r/bug-gnulib/2022-12/msg00125.html
+       * Makefile (COPYRIGHT_TZ): New macro.
+       (update-copyright): Use it.
+
 2022-12-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        assert-h: port static_assert to strict C99
index 656034d1343d2ff24fdedd53e0bf48db6ed42a2e..44295712187550e99c05d0d8ad30460ade3741ca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -159,6 +159,9 @@ MODULES.html: MODULES.html.sh
 # A perl BEGIN block to set Y to the current year number and W to Y-1.
 _year_and_prev = BEGIN{@t=localtime(time); $$y=$$t[5]+1900; $$w=$$y-1}
 
+# Which TZ setting to use when updating copyright.
+COPYRIGHT_TZ = UTC0
+
 # Run this rule once per year (usually early in January)
 # to update all FSF copyright year lists here.
 # We exclude the files listed in srclist.txt (maintained elsewhere)
@@ -170,6 +173,7 @@ _year_and_prev = BEGIN{@t=localtime(time); $$y=$$t[5]+1900; $$w=$$y-1}
 # (the current) year number in some places.
 # Also adjust version-etc.c and and gendocs.sh.
 update-copyright:
+       export TZ='$(COPYRIGHT_TZ)';                                    \
        exempt=$$(mktemp);                                              \
        grep -v '^#' config/srclist.txt|grep -v '^$$'                   \
          | while read top src dst options; do                          \
@@ -187,10 +191,13 @@ update-copyright:
          | UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79                         \
            UPDATE_COPYRIGHT_USE_INTERVALS=1                            \
              xargs build-aux/update-copyright
+       export TZ='$(COPYRIGHT_TZ)';                                    \
        perl -pi -e '$(_year_and_prev) s/(copyright.*)\b$$w\b/$$1$$y/i' \
          lib/version-etc.c doc/gnulib.texi build-aux/gendocs.sh
+       export TZ='$(COPYRIGHT_TZ)';                                    \
        perl -pi -e '$(_year_and_prev) s/ $$w-$$y / $$y /g'             \
          doc/gendocs_template* build-aux/gendocs.sh
+       export TZ='$(COPYRIGHT_TZ)';                                    \
        perl -pi -e                                                     \
           '$(_year_and_prev) s/^(scriptversion=)$$w.*/$$1$$y-01-01.00/i' \
          build-aux/gendocs.sh