bug-coreutils
[Top][All Lists]
Advanced

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

Re: It's 2007


From: Jim Meyering
Subject: Re: It's 2007
Date: Thu, 04 Jan 2007 15:21:07 +0100

Eric Blake <address@hidden> wrote:
> According to Jim Meyering on 1/4/2007 6:57 AM:
>>      sed \
>>        -e 's!@''bindir''@!$(bindir)!' \
>> +      -e 's/@''CURRENT_YEAR'@/`date +%Y`/ \
>
> I disagree with this part of the patch.  A user that builds the unmodified
> 6.8 tarball in 2008 (assuming, of course, that you release 6.8 in 2007)
> will get a different groups than intended; whereas version-etc.c has a
> hard-coded year that will not change once you cut the tarball, even if the
> tarball is compiled next year.  I was serious when I suggested grepping
> for the most recent year in the ChangeLog.

You should like this, then.
I prefer to use version-etc.c, for consistency.

        Use the release year, not the current year.
        * src/groups.sh (version): Use a better name: @address@hidden
        * src/Makefile.am (RELEASE_YEAR): Define it.
        (.sh): Use it.
        Thanks to a prod from Eric Blake.

diff --git a/src/Makefile.am b/src/Makefile.am
index ddd13ef..7aa504b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -115,11 +115,16 @@ $(PROGRAMS): ../lib/libcoreutils.a

 SUFFIXES = .sh

+# Get the release year from ../lib/version-etc.c.
+RELEASE_YEAR = \
+  `sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
+    $(top_srcdir)/lib/version-etc.c`
+
 .sh:
        rm -f $@ address@hidden
        sed \
          -e 's!@''bindir''@!$(bindir)!' \
-         -e 's/@''CURRENT_YEAR'@/`date +%Y`/ \
+         -e 's/@''RELEASE_YEAR'@/$(RELEASE_YEAR)/ \
          -e 's/@''GNU_PACKAGE''@/$(GNU_PACKAGE)/' \
          -e 's/@''PACKAGE_BUGREPORT''@/$(PACKAGE_BUGREPORT)/' \
          -e 's/@''VERSION''@/$(VERSION)/' $< > address@hidden
diff --git a/src/groups.sh b/src/groups.sh
index f416fdb..dd32c63 100755
--- a/src/groups.sh
+++ b/src/groups.sh
@@ -32,7 +32,7 @@ Same as id -Gn.  If no USERNAME, use current process.
 Report bugs to <@PACKAGE_BUGREPORT@>."

 version='groups (@GNU_PACKAGE@) @VERSION@
-Copyright (C) @CURRENT_YEAR@ Free Software Foundation, Inc.
+Copyright (C) @RELEASE_YEAR@ Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.




reply via email to

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