Collin Funk wrote:
> The announce-gen and useless-if-before-free scripts have had changes
> since their copyright date was updated:

How about deriving the --version output from the copyright notice, for
those programs that consist of a single file and that are not written in C?

Like this:

diff --git a/build-aux/run-test b/build-aux/run-test
index 94ef7fd912..0b13ed4d59 100755
--- a/build-aux/run-test
+++ b/build-aux/run-test
@@ -46,9 +46,12 @@ Send patches and bug reports to <bug-gnulib@gnu.org>."
 # outputs to stdout the --version message.
 func_version ()
 {
+  # Extract the last year from this file's copyright notice.
+  sed_extract_last_year='s/^.*\([0-9]\{4\}\)[^0-9]*$/\1/'
+  year=`sed -n -e /Copyright/p < "$progname" | sed -e 1q | sed -e 
"$sed_extract_last_year"`
   echo "\
 run-test (GNU gnulib)
-Copyright (C) 2024 Free Software Foundation, Inc.
+Copyright (C) ${year} Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law."

Advantage: Zero maintenance cost, as we rely on 'update-copyright' for the
copyright notice.

Disadvantage: It's a violation of the boundary between program code and
meta-information.

What do you think? Should we do this?

     Bruno




Reply via email to