bug-coreutils
[Top][All Lists]
Advanced

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

Re: copyright years: mass-update every January 1


From: Joel E. Denny
Subject: Re: copyright years: mass-update every January 1
Date: Mon, 27 Jul 2009 20:36:07 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

Hi Jim.

On Fri, 26 Jun 2009, Jim Meyering wrote:

> >From 85dd41402048603c977f49c5d1ea349b1c724531 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <address@hidden>
> Date: Fri, 26 Jun 2009 13:33:59 +0200
> Subject: [PATCH] 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.

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?

> +.PHONY: update-copyright
> +update-copyright:
> +     if test -d .git; then                                   \
> +       git grep -l -E '2[0-9]{3} +Free'                      \
> +         | grep -v -E '^(COPYING|ChangeLog)'                 \
> +         | xargs $(srcdir)/build-aux/$@;                     \
> +     fi

For coreutils, the above misses a few files with copyrights (listed in the 
patch below) and includes a few ChangeLogs:

  build-aux/ChangeLog-2007
  doc/ChangeLog-2007
  lib/ChangeLog-2007
  m4/ChangeLog-2007
  old/fileutils/ChangeLog
  old/textutils/ChangeLog
  po/ChangeLog-2007

Moreover, build-aux/update-copyright ignores files that have all or part 
of "Free Software Foundation" on a separate line from the last copyright 
year.  Instead of trying to make that script clever enough to handle line 
wrapping and all possible comment styles, the following patch manually 
concatenates the copyright statement lines in the affected files. 
Unfortunately, after many years, copyright statements might wrap around 
the margin several times, but I guess that's a small price.

>From 4773a2257e67950f9a0713f7a1cde16f12a06f66 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Mon, 27 Jul 2009 16:51:27 -0400
Subject: [PATCH] maint: be more careful with automatic copyright updates

* Makefile.am (update-copyright): Don't skip files whose last copyright
year is before 2000.
* build-aux/update-copyright: Document restrictions on copyright
statement format.
* tests/other-fs-tmpdir: Meet those restrictions.
* man/help2man: Likewise.
* src/dircolors.hin: Likewise.
* src/chroot.c: Likewise.
* src/echo.c: Likewise.
* src/head.c: Likewise.
* src/hostid.c: Likewise.
* src/tail.c: Likewise.
* src/touch.c: Likewise.
* m4/check-decl.m4: Likewise and update year.
* m4/lib-check.m4: Likewise.
* src/sleep.c: Likewise.
* tests/sort-time/README: Likewise.
* tests/sort-time/rand-gen: Likewise.

diff --git a/Makefile.am b/Makefile.am
index 87e4545..eb94dad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -148,7 +148,7 @@ check-ls-dircolors:
 .PHONY: update-copyright
 update-copyright:
        if test -d .git; then                                   \
-         git grep -l -E '2[0-9]{3} +Free'                      \
-           | grep -v -E '^(COPYING|ChangeLog)'                 \
+         git grep -l -E '[0-9]{4} +Free'                       \
+           | grep -v -E '(^|/)(COPYING|ChangeLog)'             \
            | xargs $(srcdir)/build-aux/$@;                     \
        fi
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index 42579c2..82125a9 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -27,6 +27,9 @@ $this_year += 1900;
 
 my $holder = 'Free Software Foundation';
 
+# The last year of the existing copyright statement must appear on the
+# same line as the copyright holder or the year will not be updated.
+
 if (/([- ])((?:\d\d)?\d\d)\s+$holder/)
   {
     my ($sep, $last_c_year) = ($1, $2);
diff --git a/m4/check-decl.m4 b/m4/check-decl.m4
index e2d20f3..7ea9fcc 100644
--- a/m4/check-decl.m4
+++ b/m4/check-decl.m4
@@ -1,8 +1,7 @@
 #serial 24
 # Check declarations for this package.
 
-dnl Copyright (C) 1997-2001, 2003-2006, 2008
-dnl Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2001, 2003-2006, 2008-2009 Free Software Foundation, 
Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/lib-check.m4 b/m4/lib-check.m4
index b2d8d96..41680b3 100644
--- a/m4/lib-check.m4
+++ b/m4/lib-check.m4
@@ -2,8 +2,7 @@
 
 dnl Misc lib-related macros for coreutils.
 
-# Copyright (C) 1993-1997, 2000-2001, 2003-2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1993-1997, 2000-2001, 2003-2006, 2008-2009 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
diff --git a/man/help2man b/man/help2man
index 7b7ce7a..c8c557b 100755
--- a/man/help2man
+++ b/man/help2man
@@ -1,8 +1,7 @@
 #!/usr/bin/perl -w
 
 # Generate a short man page from --help and --version output.
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009 
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
diff --git a/src/chroot.c b/src/chroot.c
index b773f0d..0e495d3 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -1,6 +1,5 @@
 /* chroot -- run command or shell with special root directory
-   Copyright (C) 95, 96, 1997, 1999-2004, 2007-2009
-   Free Software Foundation, Inc.
+   Copyright (C) 95, 96, 1997, 1999-2004, 2007-2009 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
diff --git a/src/dircolors.hin b/src/dircolors.hin
index 30fd878..a02ea05 100644
--- a/src/dircolors.hin
+++ b/src/dircolors.hin
@@ -1,8 +1,7 @@
 # Configuration file for dircolors, a utility to help you set the
 # LS_COLORS environment variable used by GNU ls with the --color option.
 
-# Copyright (C) 1996, 1999-2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1999-2009 Free Software Foundation, Inc.
 # Copying and distribution of this file, with or without modification,
 # are permitted provided the copyright notice and this notice are preserved.
 
diff --git a/src/echo.c b/src/echo.c
index 7b069e0..00a92dc 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -1,6 +1,5 @@
 /* echo.c, derived from code echo.c in Bash.
-   Copyright (C) 87,89, 1991-1997, 1999-2005, 2007-2009 Free Software
-   Foundation, Inc.
+   Copyright (C) 87,89, 1991-1997, 1999-2005, 2007-2009 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
diff --git a/src/head.c b/src/head.c
index c96f910..89b6ef9 100644
--- a/src/head.c
+++ b/src/head.c
@@ -1,6 +1,5 @@
 /* head -- output first part of file(s)
-   Copyright (C) 89, 90, 91, 1995-2006, 2008-2009 Free Software
-   Foundation, Inc.
+   Copyright (C) 89, 90, 91, 1995-2006, 2008-2009 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
diff --git a/src/hostid.c b/src/hostid.c
index 1da5a0c..a3d8f86 100644
--- a/src/hostid.c
+++ b/src/hostid.c
@@ -1,7 +1,6 @@
 /* print the hexadecimal identifier for the current host
 
-   Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2007-2009 Free
-   Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2007-2009 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
diff --git a/src/sleep.c b/src/sleep.c
index 0c11b8e..fd21e7b 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -1,6 +1,5 @@
 /* sleep - delay for a specified amount of time.
-   Copyright (C) 84, 1991-1997, 1999-2005, 2007-2008
-   Free Software Foundation, Inc.
+   Copyright (C) 84, 1991-1997, 1999-2005, 2007-2009 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
diff --git a/src/tail.c b/src/tail.c
index fd44e22..40394ac 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1,6 +1,5 @@
 /* tail -- output the last part of file(s)
-   Copyright (C) 1989, 90, 91, 1995-2006, 2008-2009 Free Software
-   Foundation, Inc.
+   Copyright (C) 1989, 90, 91, 1995-2006, 2008-2009 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
diff --git a/src/touch.c b/src/touch.c
index 3d6d9fa..fd2c938 100644
--- a/src/touch.c
+++ b/src/touch.c
@@ -1,6 +1,5 @@
 /* touch -- change modification and access times of files
-   Copyright (C) 87, 1989-1991, 1995-2005, 2007-2009
-   Free Software Foundation, Inc.
+   Copyright (C) 87, 1989-1991, 1995-2005, 2007-2009 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
diff --git a/tests/other-fs-tmpdir b/tests/other-fs-tmpdir
index 4340ac5..c146e0b 100644
--- a/tests/other-fs-tmpdir
+++ b/tests/other-fs-tmpdir
@@ -4,8 +4,7 @@
 # of the current directory.  If one is found, create a temporary directory
 # inside it.
 
-# Copyright (C) 1998, 1999, 2001, 2002, 2005, 2007-2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2001, 2002, 2005, 2007-2009 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
diff --git a/tests/sort-time/README b/tests/sort-time/README
index b74eac7..0d16a67 100644
--- a/tests/sort-time/README
+++ b/tests/sort-time/README
@@ -1,6 +1,6 @@
 # determine whether it's worthwhile to add a --line-length=N option to sort.
 
-# Copyright (C) 1997 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2009 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
diff --git a/tests/sort-time/rand-gen b/tests/sort-time/rand-gen
index efc7f84..554848f 100644
--- a/tests/sort-time/rand-gen
+++ b/tests/sort-time/rand-gen
@@ -3,7 +3,7 @@
 # Each value is in the range [0,1).
 # Usage: rand n
 
-# Copyright (C) 1997 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2009 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
-- 
1.5.4.3





reply via email to

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