1 #!/usr/bin/perl -0777 -pi
2 # Update an FSF copyright year list to include the current year.
4 my $VERSION = '2009-07-29.13:34'; # UTC
6 # Copyright (C) 2009 Free Software Foundation
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # Written by Jim Meyering
26 my ($sec, $min, $hour, $mday, $month, $year) = localtime (time());
27 my $this_year = $year + 1900;
28 my $holder = 'Free Software Foundation';
30 if (/([- ])((?:\d\d)?\d\d)((?:\n\#)?\s+$holder)/s)
32 my ($sep, $last_c_year, $rest) = ($1, $2, $3);
34 # Handle two-digit year numbers like "98" and "99".
36 and $last_c_year += 1900;
38 if ($last_c_year != $this_year)
40 if ($sep eq '-' && $last_c_year + 1 == $this_year)
44 elsif ($sep eq ' ' && $last_c_year + 1 == $this_year)
46 s// $last_c_year-$this_year$rest/;
50 s//$sep$last_c_year, $this_year$rest/;
56 # indent-tabs-mode: nil
57 # eval: (add-hook 'write-file-hooks 'time-stamp)
58 # time-stamp-start: "my $VERSION = '"
59 # time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
60 # time-stamp-time-zone: "UTC"
61 # time-stamp-end: "'; # UTC"