]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Improve copyright updating.
authorEric Blake <ebb9@byu.net>
Fri, 14 Aug 2009 15:09:26 +0000 (09:09 -0600)
committerEric Blake <ebb9@byu.net>
Mon, 17 Aug 2009 12:50:32 +0000 (06:50 -0600)
* build-aux/update-copyright: Resynchronize from upstream.
* maint.mk (update-copyright): Simplify based on gnulib.
(update-copyright-env): New variable.
* cfg.mk (update-copyright-exclude-regexp): Delete.
(update-copyright-env): New override.
* .x-update-copyright: New file.
* lib/Autom4te/Makefile.am: Add copyright.
* lib/Autom4te/Channels.pm: Revert copyright update to upstream
file.
* lib/Autom4te/Configure_ac.pm: Likewise.
* lib/Autom4te/FileUtils.pm: Likewise.
* lib/Autom4te/Struct.pm: Likewise.
* lib/Autom4te/XFile.pm: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
.x-update-copyright [new file with mode: 0644]
ChangeLog
build-aux/update-copyright
cfg.mk
lib/Autom4te/Channels.pm
lib/Autom4te/Configure_ac.pm
lib/Autom4te/FileUtils.pm
lib/Autom4te/Makefile.am
lib/Autom4te/Struct.pm
maint.mk

diff --git a/.x-update-copyright b/.x-update-copyright
new file mode 100644 (file)
index 0000000..1780d9b
--- /dev/null
@@ -0,0 +1,16 @@
+# Prior year changelogs don't need update.
+ChangeLog..*
+# Upstream files that should not have copyright updated here.
+COPYING.*
+GNUmakefile
+build-aux/.*
+lib/Autom4te/Configure_ac.pm
+lib/Autom4te/Channels.pm
+lib/Autom4te/FileUtils.pm
+lib/Autom4te/Struct.pm
+lib/Autom4te/XFile.pm
+doc/fdl.*
+doc/gendocs_template
+doc/gnu-oids.texi
+doc/make-stds.texi
+doc/standards.texi
index 3baf7a61f1b852d443b21d43283818fb35f8ee00..a9c83746133c8aaf805e0c260390c231ace7f2fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2009-08-14  Eric Blake  <ebb9@byu.net>
 
+       Improve copyright updating.
+       * build-aux/update-copyright: Resynchronize from upstream.
+       * maint.mk (update-copyright): Simplify based on gnulib.
+       (update-copyright-env): New variable.
+       * cfg.mk (update-copyright-exclude-regexp): Delete.
+       (update-copyright-env): New override.
+       * .x-update-copyright: New file.
+       * lib/Autom4te/Makefile.am: Add copyright.
+       * lib/Autom4te/Channels.pm: Revert copyright update to upstream
+       file.
+       * lib/Autom4te/Configure_ac.pm: Likewise.
+       * lib/Autom4te/FileUtils.pm: Likewise.
+       * lib/Autom4te/Struct.pm: Likewise.
+       * lib/Autom4te/XFile.pm: Likewise.
+
        Update copyright.
        * AUTHORS: Include 2009 in copyright.
        * lib/Autom4te/C4che.pm: Likewise.
@@ -38,7 +53,7 @@
        Prepare to bulk update copyright years.
        * build-aux/update-copyright: New file.
        * cfg.mk (gnulib-update): Sync it from gnulib.
-       (update-copyright-exclude-regexp): New varialbe.
+       (update-copyright-exclude-regexp): New variable.
        (web-manual): Move...
        * maint.mk (web-manual): ...here, to match gnulib.
        (update-copyright): New target, copied from gnulib's
index d8445fee08af75f81462904872a444d576386b2a..bd0dda5dcb1a966ca6d1cef29213dd673b6e4978 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -0777 -pi
 # Update an FSF copyright year list to include the current year.
 
-my $VERSION = '2009-08-14.05:03'; # UTC
+my $VERSION = '2009-08-14.18:56'; # UTC
 
 # Copyright (C) 2009 Free Software Foundation, Inc.
 #
@@ -25,12 +25,17 @@ my $VERSION = '2009-08-14.05:03'; # UTC
 # use the update-copyright target rule in maint.mk from gnulib's
 # maintainer-makefile module.
 #
-# Iff an FSF copyright statement is discovered in a file and the final
+# Iff an FSF copyright statement is recognized in a file and the final
 # year is not the current year, then the statement is updated for the
-# new year, 2-digit years are converted to 4-digit years by prepending
-# "19", and the statement is reformatted to fit within 72 columns.  A
-# warning is printed for every file for which no FSF copyright statement
-# is discovered.
+# new year and it is reformatted to:
+#
+#   1. Fit within 72 columns.
+#   2. Convert 2-digit years to 4-digit years by prepending "19".
+#   3. Expand copyright year intervals.  (See "Environment variables"
+#      below.)
+#
+# A warning is printed for every file for which no FSF copyright
+# statement is recognized.
 #
 # Each file's FSF copyright statement must be formated correctly in
 # order to be recognized.  For example, each of these is fine:
@@ -91,16 +96,21 @@ my $VERSION = '2009-08-14.05:03'; # UTC
 #   6. Blank lines, even if preceded by the prefix, do not appear
 #      within the FSF copyright statement.
 #   7. Each copyright year is 2 or 4 digits, and years are separated by
-#      commas or dashes.  Whitespace may occur after commas.
+#      commas or dashes.  Whitespace may appear after commas.
 #
 # Environment variables:
 #
-#   1. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive
-#      copyright years (such as 90, 1991, 1992-2007, 2008) in an updated
-#      FSF copyright statement is collapsed to a single interval (such
-#      as 1990-2008).  If unset or set to 0, all existing copyright year
-#      intervals are expanded.
-#   2. For testing purposes, you can set the assumed current year in
+#   1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement
+#      is reformatted even if it does not need updating for the new
+#      year.  If unset or set to 0, only updated FSF copyright
+#      statements are reformatted.
+#   2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive
+#      copyright years (such as 90, 1991, 1992-2007, 2008) in a
+#      reformatted FSF copyright statement is collapsed to a single
+#      interval (such as 1990-2008).  If unset or set to 0, all existing
+#      copyright year intervals in a reformatted FSF copyright statement
+#      are expanded instead.
+#   3. For testing purposes, you can set the assumed current year in
 #      UPDATE_COPYRIGHT_YEAR.
 
 use strict;
@@ -172,7 +182,9 @@ if (defined $stmt_re)
       {
         # Update the year.
         $stmt =~ s/$final_year_orig/$final_year, $this_year/;
-
+      }
+    if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
+      {
         # Normalize all whitespace including newline-prefix sequences.
         $stmt =~ s/$ws_re/ /g;
 
diff --git a/cfg.mk b/cfg.mk
index deb8c69a2500c94e0cbc4c12ffb97bb88ef538dd..6b246d5444b726d35a98e06088f858590ec72c70 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -109,8 +109,5 @@ autom4te-update:
 local-checks-to-skip ?= \
   changelog-check sc_unmarked_diagnostics
 
-# Don't adjust copyright in upstream files.
-update-copyright-exclude-regexp = \
-(^|/)(COPYING|build-aux/|GNUmakefile\
-|Autom4te/(Configure_ac|Channels|FileUtils|Struct|XFile)\
-|doc/(fdl|gendocs|gnu-oids|make-stds|standards)).*$$
+# Always use longhand copyrights.
+update-copyright-env = UPDATE_COPYRIGHT_USE_INTERVALS=0
index 86723eedf2c350b89f6ac6b16b84703812a9985e..1309d204ad2a6ec48fc87ce4745d5f11a49c5484 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright (C) 2002, 2004, 2006, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 2002, 2004, 2006, 2008 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
index fe39bc7bb4660b51e79e775751b92b512b626e83..5ff8d57832925f7e0dd4095f6d4c0b827d5edbab 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright (C) 2003, 2005, 2006, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 2003, 2005, 2006  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
index c12498ac4e52c5637f76ee465b46afa7b013e9da..63420f6b3b32b22bb494060ff330ec53db7a8671 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
-# Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008  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
index 68321507834fe11c92a894925ff9aa7df3f58d94..85667ee8ffa67b903f11b18d05ddde537679a340 100644 (file)
@@ -1,5 +1,20 @@
 ## Process this file with automake to create Makefile.in
 
+# Copyright (C) 2001, 2003, 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
+# the Free Software Foundation, either version 3 of the License, 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/>.
+
 perllibdir = $(pkgdatadir)/Autom4te
 dist_perllib_DATA = \
   C4che.pm \
index 9b511fd55f74f622401c5a8bb834f3df21008df0..73c25ddaa0ba50191d39dd752a674d2ae9346cc5 100644 (file)
@@ -1,6 +1,5 @@
 # autoconf -- create `configure' using m4 macros
-# Copyright (C) 2001, 2002, 2006, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2002, 2006 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
index 6394508f6da57ec592b0acea139001a5226dde70..868ba505fca8acc08de014ad4d21257d250521c0 100644 (file)
--- a/maint.mk
+++ b/maint.mk
@@ -590,15 +590,19 @@ web-manual:
            "$(PACKAGE_NAME) - $(manual_title)"
        @echo " *** Upload the doc/manual directory to web-cvs."
 
-# If you have an additional project-specific rule,
-# define it in cfg.mk and set this variable to its name.
-update-copyright-local ?=
+# If you want to set UPDATE_COPYRIGHT_* environment variables,
+# put the assignments in this variable.
+update-copyright-env ?=
 
 # Run this rule once per year (usually early in January)
 # to update all FSF copyright year lists in your project.
-update-copyright-exclude-regexp ?= (^|/)COPYING$$
+# If you have an additional project-specific rule,
+# add it in cfg.mk along with a line 'update-copyright: prereq'.
+# By default, exclude all variants of COPYING; you can also
+# add exemptions (such as ChangeLog..* for rotated change logs)
+# in the file .x-update-copyright.
 .PHONY: update-copyright
-update-copyright: $(update-copyright-local)
+update-copyright:
        grep -l -w Copyright $$($(VC_LIST_EXCEPT))              \
-         | grep -v -E '$(update-copyright-exclude-regexp)'     \
-         | xargs $(build_aux)/$@
+               $(srcdir)/ChangeLog | grep -v COPYING           \
+         | $(update-copyright-env) xargs $(build_aux)/$@