Hi Tys, On Thu, 21 Jan 2010, tys lefering wrote:
> using bison from git repo and doing bison --version: > > bison (GNU Bison) 2.4.464-fca9c-dirty > Written by Robert Corbett and Richard Stallman. > > Copyright (C) 2008 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > and noticed the Copyright year needs update to 2010. > > it is set in configure.ac in a macro > AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2008], > [The copyright year for this package]) > AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2008]) Thanks for the reminder. We normally take care of that at release time, and there's a reminder in our release procedure in HACKING so we don't forget. 2008 was indeed the year of our last release, 2.4.1. However, now that you mention it, this ought to be automated like the rest of our copyright updates. Here's a patch that I'll push later today. I should rewrite the reminder in HACKING to mention that all copyright updates are automated but should be checked by hand a little anyway. >From 63e61e7465917c02005a06277ee07a31e7c96048 Mon Sep 17 00:00:00 2001 From: Joel E. Denny <[email protected]> Date: Thu, 21 Jan 2010 12:18:45 -0500 Subject: [PATCH] maint: automate PACKAGE_COPYRIGHT_YEAR update, and run it. * Makefile.am (update-package-copyright-year): New target rule. * build-aux/update-package-copyright-year: New file. * cfg.mk (update-copyright): Make update-package-copyright-year a dependency. --- ChangeLog | 8 +++++ Makefile.am | 4 ++- build-aux/update-package-copyright-year | 49 +++++++++++++++++++++++++++++++ cfg.mk | 2 +- configure.ac | 4 +- 5 files changed, 63 insertions(+), 4 deletions(-) create mode 100755 build-aux/update-package-copyright-year diff --git a/ChangeLog b/ChangeLog index 7201031..331202a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-01-21 Joel E. Denny <[email protected]> + + maint: automate PACKAGE_COPYRIGHT_YEAR update, and run it. + * Makefile.am (update-package-copyright-year): New target rule. + * build-aux/update-package-copyright-year: New file. + * cfg.mk (update-copyright): Make update-package-copyright-year + a dependency. + 2010-01-19 Joel E. Denny <[email protected]> * bootstrap: Import improvements from latest gnulib. diff --git a/Makefile.am b/Makefile.am index 8a705de..be77876 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,9 +57,11 @@ $(top_srcdir)/.version: configure dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -.PHONY: update-b4-copyright +.PHONY: update-b4-copyright update-configure-copyright update-b4-copyright: find data -type f \ | grep -v -E '^data/bison.m4$$' \ | xargs $(build_aux)/$@ @echo 'warning: src/parse-gram.[hc] may need to be regenerated.' +update-package-copyright-year: + $(build_aux)/$@ configure.ac diff --git a/build-aux/update-package-copyright-year b/build-aux/update-package-copyright-year new file mode 100755 index 0000000..b5b62e9 --- /dev/null +++ b/build-aux/update-package-copyright-year @@ -0,0 +1,49 @@ +#!/usr/bin/perl -0777 -pi + +# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year. + +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use strict; +use warnings; + +my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR}; +if (!$this_year || $this_year !~ m/^\d{4}$/) + { + my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ()); + $this_year = $year + 1900; + } +my $old_re = <<'EOF' + ( + MACRO\( + \[PACKAGE_COPYRIGHT_YEAR], + \s*\[ + ) + (\d{4}) + (?=]) +EOF + ; +foreach my $macro ("AC_DEFINE", "AC_SUBST") + { + my $this_old_re = $old_re; + $this_old_re =~ s/MACRO/$macro/; + if (!s/$this_old_re/$1$this_year/x) + { + print STDERR + "$ARGV: warning: failed to update PACKAGE_COPYRIGHT_YEAR in" + . " $macro.\n"; + } + } diff --git a/cfg.mk b/cfg.mk index e8cdfbf..4ecb8e2 100644 --- a/cfg.mk +++ b/cfg.mk @@ -43,6 +43,6 @@ gnulib_dir = $(srcdir)/../../gnulib bootstrap-tools = autoconf,automake,flex,gnulib -update-copyright: update-b4-copyright +update-copyright: update-b4-copyright update-package-copyright-year update-copyright-env = \ UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1 diff --git a/configure.ac b/configure.ac index 4a66217..3caf935 100644 --- a/configure.ac +++ b/configure.ac @@ -21,9 +21,9 @@ AC_PREREQ(2.61) AC_INIT([GNU Bison], m4_esyscmd([build-aux/git-version-gen .tarball-version]), [[email protected]]) -AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2008], +AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2010], [The copyright year for this package]) -AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2008]) +AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2010]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) -- 1.5.4.3
