bug-coreutils
[Top][All Lists]
Advanced

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

new module: update-copyright [Re: copyright years: mass-update every Jan


From: Jim Meyering
Subject: new module: update-copyright [Re: copyright years: mass-update every January 1
Date: Wed, 29 Jul 2009 16:26:41 +0200

Joel E. Denny wrote:

> On Wed, 29 Jul 2009, Jim Meyering wrote:
>
>> Joel E. Denny wrote:
>
>> > I'd like to use this in Bison.  Would you consider contributing
>> > build-aux/update-copyright to gnulib so we don't maintain separate copies?
>>
>> Sure.
>
> Thanks.  I'll watch for that.  In the meantime, I'll probably import a
> copy into Bison.

I've just pushed it to gnulib:

>From 8dc0e5d63e272095754e3144e64dc6b1c8791d9e Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 29 Jul 2009 16:22:21 +0200
Subject: [PATCH] update-copyright: new module

* modules/update-copyright: New file.
* build-aux/update-copyright: New file.
* MODULES.html.sh (maint+release support): Add update-copyright.
---
 ChangeLog                  |    7 +++++
 MODULES.html.sh            |    1 +
 build-aux/update-copyright |   62 ++++++++++++++++++++++++++++++++++++++++++++
 modules/update-copyright   |   19 +++++++++++++
 4 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100755 build-aux/update-copyright
 create mode 100644 modules/update-copyright

diff --git a/ChangeLog b/ChangeLog
index fa9a76b..2be276a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-29  Jim Meyering  <address@hidden>
+
+       update-copyright: new module
+       * modules/update-copyright: New file.
+       * build-aux/update-copyright: New file.
+       * MODULES.html.sh (maint+release support): Add update-copyright.
+
 2009-07-27  Bruno Haible  <address@hidden>

        Fix compilation error when <ctime> is used and mktime is replaced.
diff --git a/MODULES.html.sh b/MODULES.html.sh
index 6adef20..ef48ec5 100755
--- a/MODULES.html.sh
+++ b/MODULES.html.sh
@@ -3179,6 +3179,7 @@ func_all_modules ()
   func_module gnupload
   func_module maintainer-makefile
   func_module mktempd
+  func_module update-copyright
   func_module useless-if-before-free
   func_module vc-list-files
   func_end_table
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
new file mode 100755
index 0000000..1ceaf8a
--- /dev/null
+++ b/build-aux/update-copyright
@@ -0,0 +1,62 @@
+#!/usr/bin/perl -0777 -pi
+# Update an FSF copyright year list to include the current year.
+
+my $VERSION = '2009-07-29.13:34'; # 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;
+use warnings;
+
+my ($sec, $min, $hour, $mday, $month, $year) = localtime (time());
+my $this_year = $year + 1900;
+my $holder = 'Free Software Foundation';
+
+if (/([- ])((?:\d\d)?\d\d)((?:\n\#)?\s+$holder)/s)
+  {
+    my ($sep, $last_c_year, $rest) = ($1, $2, $3);
+
+    # 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$rest/;
+          }
+        elsif ($sep eq ' ' && $last_c_year + 1 == $this_year)
+          {
+            s// $last_c_year-$this_year$rest/;
+          }
+        else
+          {
+            s//$sep$last_c_year, $this_year$rest/;
+          }
+      }
+  }
+
+# 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:%02M"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "'; # UTC"
+# End:
diff --git a/modules/update-copyright b/modules/update-copyright
new file mode 100644
index 0000000..c703c68
--- /dev/null
+++ b/modules/update-copyright
@@ -0,0 +1,19 @@
+Description:
+Update an FSF copyright year list to include the current year.
+
+Files:
+build-aux/update-copyright
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+
+Include:
+
+License:
+GPLed build tool
+
+Maintainer:
+Jim Meyering
--
1.6.4.rc3.201.gd9d59




reply via email to

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