bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Collin Funk <collin.funk1@gmail.com>
To: Bruno Haible <bruno@clisp.org>, bug-gnulib@gnu.org
Subject: Re: Can we have gnulib-tool.py emit the same copyright header?
Date: Wed, 28 Feb 2024 13:18:02 -0800	[thread overview]
Message-ID: <7a33114b-0c10-4b52-b2d8-7d322a8d90ae@gmail.com> (raw)
In-Reply-To: <6619075.yaVYbkx8dN@nimes>

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

On 2/28/24 3:00 AM, Bruno Haible wrote:
> I'm committing these three patches, that fix the version output also in the
> presence of
> 
> [log]
> 	date = relative

Nice. I wasn't aware of this option. Your fixes give me the correct
date and time now.

How does this patch look for fixing the copyright headers? I could
have just used constants.__copyright__ in GLEmiter, but I thought it
was best to put in GLInfo just in case it is needed elsewhere later.

Collin

[-- Attachment #2: 0001-gnulib-tool.py-Emit-year-range-on-file-copyright-not.patch --]
[-- Type: text/x-patch, Size: 2166 bytes --]

From 67a69b85467f1641f5e8741a22c929cdf8268cd8 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.funk1@gmail.com>
Date: Wed, 28 Feb 2024 13:12:05 -0800
Subject: [PATCH] gnulib-tool.py: Emit year range on file copyright notices.

* pygnulib/GLInfo.py (GLInfo.copyright_range): New function. Return a
copyright string with a year range.
* pygnulib/GLEmiter.py (GLEmiter.copyright_notice): Use the new function
for file copyright headers.
---
 ChangeLog            | 8 ++++++++
 pygnulib/GLEmiter.py | 2 +-
 pygnulib/GLInfo.py   | 4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8cfe498940..02d22de00f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-02-28  Collin Funk  <collin.funk1@gmail.com>
+
+	gnulib-tool.py: Emit year range on file copyright notices.
+	* pygnulib/GLInfo.py (GLInfo.copyright_range): New function. Return a
+	copyright string with a year range.
+	* pygnulib/GLEmiter.py (GLEmiter.copyright_notice): Use the new function
+	for file copyright headers.
+
 2024-02-28  Collin Funk  <collin.funk1@gmail.com>
 
 	gnulib-tool.py: Make module sorting more similar to gnulib-tool.
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index d8cc085f59..260478e5da 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -73,7 +73,7 @@ class GLEmiter(object):
         '''GLEmiter.copyright_notice() -> str
 
         Emit a header for a generated file.'''
-        emit = "# %s" % self.info.copyright()
+        emit = '# %s' % self.info.copyright_range()
         emit += """
 #
 # This file is free software; you can redistribute it and/or modify
diff --git a/pygnulib/GLInfo.py b/pygnulib/GLInfo.py
index a0a70270a9..1934fde103 100644
--- a/pygnulib/GLInfo.py
+++ b/pygnulib/GLInfo.py
@@ -125,6 +125,10 @@ class GLInfo(object):
         result = re.compile(' .*').sub('', first_changelog_line)
         return result
 
+    def copyright_range(self):
+        '''Returns a formated copyright string showing a year range.'''
+        return f'Copyright (C) {constants.__copyright__}'
+
     def usage(self):
         '''Show help message.'''
         result = '''\
-- 
2.39.2


  reply	other threads:[~2024-02-28 21:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28  1:41 Can we have gnulib-tool.py emit the same copyright header? Collin Funk
2024-02-28  2:07 ` Bruno Haible
2024-02-28  2:19   ` Collin Funk
2024-02-28  2:26     ` Bruno Haible
2024-02-28  2:51       ` Collin Funk
2024-02-28  7:53         ` Collin Funk
2024-02-28 11:00           ` Bruno Haible
2024-02-28 21:18             ` Collin Funk [this message]
2024-02-28 21:30               ` Bruno Haible
2024-02-28 21:48                 ` Collin Funk
2024-02-28 23:34                   ` Bruno Haible

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=7a33114b-0c10-4b52-b2d8-7d322a8d90ae@gmail.com \
    --to=collin.funk1@gmail.com \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.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).