]>
git.saurik.com Git - bison.git/blob - build-aux/update-package-copyright-year
1 #!/usr/bin/perl -0777 -pi
3 # In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
5 # Copyright (C) 2010 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR
};
24 if (!$this_year || $this_year !~ m/^\d{4}$/)
26 my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
27 $this_year = $year + 1900;
32 \[PACKAGE_COPYRIGHT_YEAR],
39 foreach my $macro ("AC_DEFINE", "AC_SUBST")
41 my $this_old_re = $old_re;
42 $this_old_re =~ s/MACRO/$macro/;
43 if (!s/$this_old_re/$1$this_year/x)
46 "$ARGV: warning: failed to update PACKAGE_COPYRIGHT_YEAR in"