diff options
author | Jim Meyering <meyering@redhat.com> | 2009-06-26 13:33:59 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-06-27 09:16:59 +0200 |
commit | e472f8fece400b6cb8a93dee7476cdb257f64d2f (patch) | |
tree | c7cfb3143435ff8e739ee187b073eade361839a1 /build-aux | |
parent | 1c16c9598e67e0db641af8b85abf8c009e3a9226 (diff) | |
download | coreutils-e472f8fece400b6cb8a93dee7476cdb257f64d2f.tar.xz |
maint: add a rule to automate the annual copyright-year-update process
* build-aux/update-copyright: New file.
* Makefile.am (changelog_etc): Add update-copyright.
(update-copyright): New rule.
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/update-copyright | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/build-aux/update-copyright b/build-aux/update-copyright new file mode 100755 index 000000000..42579c28f --- /dev/null +++ b/build-aux/update-copyright @@ -0,0 +1,62 @@ +#!/usr/bin/perl -w -pi +# Update an FSF copyright year list to include the current year. + +my $VERSION = '2009-06-04 08:53'; # UTC + +# Copyright (C) 2009 Free Software Foundation +# +# 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/>. + +# Written by Jim Meyering + +use strict; + +my ($sec, $min, $hour, $mday, $month, $this_year) = localtime (time()); +$this_year += 1900; + +my $holder = 'Free Software Foundation'; + +if (/([- ])((?:\d\d)?\d\d)\s+$holder/) + { + my ($sep, $last_c_year) = ($1, $2); + + # Handle two-digit year numbers like "98" and "99". + $last_c_year <= 99 + and $last_c_year += 1900; + + if ($last_c_year != $this_year) + { + if ($sep eq '-' && $last_c_year + 1 == $this_year) + { + s//-$this_year $holder/; + } + elsif ($sep eq ' ' && $last_c_year + 1 == $this_year) + { + s// $last_c_year-$this_year $holder/; + } + else + { + s//$sep$last_c_year, $this_year $holder/; + } + } + } + +# Local variables: +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "'; # UTC" +# End: |