bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Simon Josefsson <simon@josefsson.org>
Cc: bug-gnulib@gnu.org
Subject: Re: [PATCH] maint: run 'make update-copyright'
Date: Sat, 31 Dec 2022 18:47:06 -0800	[thread overview]
Message-ID: <4e53e84b-bc43-afc2-6693-628bc42832cf@cs.ucla.edu> (raw)
In-Reply-To: <87k027yuj2.fsf@josefsson.org>

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

On 2022-12-31 16:21, Simon Josefsson via Gnulib discussion list wrote:
> I wonder how timezone-safe this is -- maybe some other test will now
> fail for someone in the US before it actually becomes midnight there?

Let's standardize on UTC for this sort of thing. This isn't perfect 
(e.g., clock skew, or leap seconds!) but it should be good enough for 
us. I installed the attached.

[-- Attachment #2: 0001-maint-use-UTC-when-updating-copyright-date.patch --]
[-- Type: text/x-patch, Size: 2503 bytes --]

From 875461ffdf58ac04677957b4ae4160465b83b940 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 31 Dec 2022 18:40:56 -0800
Subject: [PATCH] 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.
---
 ChangeLog | 8 ++++++++
 Makefile  | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index ef7f457143..8ef7d0c26a 100644
--- 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
diff --git a/Makefile b/Makefile
index 656034d134..4429571218 100644
--- 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
-- 
2.37.2


      reply	other threads:[~2023-01-01  2:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-01  0:21 [PATCH] maint: run 'make update-copyright' Simon Josefsson via Gnulib discussion list
2023-01-01  2:47 ` Paul Eggert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e53e84b-bc43-afc2-6693-628bc42832cf@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bug-gnulib@gnu.org \
    --cc=simon@josefsson.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).