gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_2_9_9-75-g4b69994


From: Simon Josefsson
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_9_9-75-g4b69994
Date: Tue, 26 Jan 2010 17:41:37 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=4b699948260c21eb97fe4a0f5a57c20e038d3d59

The branch, master has been updated
       via  4b699948260c21eb97fe4a0f5a57c20e038d3d59 (commit)
      from  4e5d5518c6cb5807d4b42111ee513d73c06bf9ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4b699948260c21eb97fe4a0f5a57c20e038d3d59
Author: Simon Josefsson <address@hidden>
Date:   Tue Jan 26 18:41:32 2010 +0100

    Update gnulib files.

-----------------------------------------------------------------------

Summary of changes:
 build-aux/update-copyright        |  266 +++++++++++++++++++
 gl/Makefile.am                    |    9 +-
 gl/m4/gnulib-cache.m4             |    3 +-
 gl/m4/gnulib-comp.m4              |    4 +
 gl/tests/Makefile.am              |    8 +
 gl/tests/test-update-copyright.sh |  526 +++++++++++++++++++++++++++++++++++++
 6 files changed, 814 insertions(+), 2 deletions(-)
 create mode 100755 build-aux/update-copyright
 create mode 100755 gl/tests/test-update-copyright.sh

diff --git a/build-aux/update-copyright b/build-aux/update-copyright
new file mode 100755
index 0000000..28ff441
--- /dev/null
+++ b/build-aux/update-copyright
@@ -0,0 +1,266 @@
+eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}'
+  & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
+    if 0;
+# Update an FSF copyright year list to include the current year.
+
+my $VERSION = '2009-12-28.11:09'; # UTC
+
+# Copyright (C) 2009-2010 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, 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 and Joel E. Denny
+
+# The arguments to this script should be names of files that contain FSF
+# copyright statements to be updated.  For example, you might wish to
+# use the update-copyright target rule in maint.mk from gnulib's
+# maintainer-makefile module.
+#
+# 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 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:
+#
+#   Copyright @copyright{} 1990-2005, 2007-2009 Free Software
+#   Foundation, Inc.
+#
+#   # Copyright (C) 1990-2005, 2007-2009 Free Software
+#   # Foundation, Inc.
+#
+#   /*
+#    * Copyright &copy; 90,2005,2007-2009
+#    * Free Software Foundation, Inc.
+#    */
+#
+# However, the following format is not recognized because the line
+# prefix changes after the first line:
+#
+#   ## Copyright (C) 1990-2005, 2007-2009 Free Software
+#   #  Foundation, Inc.
+#
+# The following copyright statement is not recognized because the
+# copyright holder is not the FSF:
+#
+#   Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+#
+# However, any correctly formatted FSF copyright statement following
+# either of the previous two copyright statements would be recognized.
+#
+# The exact conditions that a file's FSF copyright statement must meet
+# to be recognized are:
+#
+#   1. It is the first FSF copyright statement that meets all of the
+#      following conditions.  Subsequent FSF copyright statements are
+#      ignored.
+#   2. Its format is "Copyright (C)", then a list of copyright years,
+#      and then the name of the copyright holder, which is "Free
+#      Software Foundation, Inc.".
+#   3. The "(C)" takes one of the following forms or is omitted
+#      entirely:
+#
+#        A. (C)
+#        B. (c)
+#        C. @copyright{}
+#        D. &copy;
+#
+#   4. The "Copyright" appears at the beginning of a line except that it
+#      may be prefixed by any sequence (e.g., a comment) of no more than
+#      5 characters.
+#   5. Iff such a prefix is present, the same prefix appears at the
+#      beginning of each remaining line within the FSF copyright
+#      statement.  There is one exception in order to support C-style
+#      comments: if the first line's prefix contains nothing but
+#      whitespace surrounding a "/*", then the prefix for all subsequent
+#      lines is the same as the first line's prefix except with each of
+#      "/" and possibly "*" replaced by a " ".  The replacement of "*"
+#      by " " is consistent throughout all subsequent lines.
+#   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 appear after commas.
+#
+# Environment variables:
+#
+#   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.
+#   4. The default maximum line length for a copyright line is 72.
+#      Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length.
+
+use strict;
+use warnings;
+
+my $copyright_re = 'Copyright';
+my $circle_c_re = '(?:\([cC]\)|@copyright{}|&copy;)';
+my $holder = 'Free Software Foundation, Inc.';
+my $prefix_max = 5;
+my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH};
+!$margin || $margin !~ m/^\d+$/
+  and $margin = 72;
+
+my $tab_width = 8;
+
+my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
+if (!$this_year || $this_year !~ m/^\d{4}$/)
+  {
+    my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
+    $this_year = $year + 1900;
+  }
+
+# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead.
+my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n";
+
+my $leading;
+my $prefix;
+my $ws_re;
+my $stmt_re;
+while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
+  {
+    $leading = "$1$2";
+    $prefix = $2;
+    if ($prefix =~ /^(\s*\/)\*(\s*)$/)
+      {
+        $prefix =~ s,/, ,;
+        my $prefix_ws = $prefix;
+        $prefix_ws =~ s/\*/ /; # Only whitespace.
+        if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/)
+          {
+            $prefix = $prefix_ws;
+          }
+      }
+    $ws_re = '[ \t\r\f]'; # \s without \n
+    $ws_re =
+      "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)";
+    my $holder_re = $holder;
+    $holder_re =~ s/\s/$ws_re/g;
+    my $stmt_remainder_re =
+      "(?:$ws_re$circle_c_re)?"
+      . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
+      . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
+    if (/\G$stmt_remainder_re/)
+      {
+        $stmt_re =
+          quotemeta($leading) . "($copyright_re$stmt_remainder_re)";
+        last;
+      }
+  }
+if (defined $stmt_re)
+  {
+    /$stmt_re/ or die; # Should never die.
+    my $stmt = $1;
+    my $final_year_orig = $2;
+
+    # Handle two-digit year numbers like "98" and "99".
+    my $final_year = $final_year_orig;
+    $final_year <= 99
+      and $final_year += 1900;
+
+    if ($final_year != $this_year)
+      {
+        # 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;
+
+        # Put spaces after commas.
+        $stmt =~ s/, ?/, /g;
+
+        # Convert 2-digit to 4-digit years.
+        $stmt =~ s/(\b\d\d\b)/19$1/g;
+
+        # Make the use of intervals consistent.
+        if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
+          {
+            $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
+          }
+        else
+          {
+            $stmt =~
+              s/
+                (\d{4})
+                (?:
+                  (,\ |-)
+                  ((??{
+                    if    ($2 eq '-') { '\d{4}'; }
+                    elsif (!$3)       { $1 + 1;  }
+                    else              { $3 + 1;  }
+                  }))
+                )+
+              /$1-$3/gx;
+          }
+
+        # Format within margin.
+        my $stmt_wrapped;
+        my $text_margin = $margin - length($prefix);
+        if ($prefix =~ /^(\t+)/)
+          {
+            $text_margin -= length($1) * ($tab_width - 1);
+          }
+        while (length $stmt)
+          {
+            if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//)
+                || ($stmt =~ s/^([\S]+)(?: |$)//))
+              {
+                my $line = $1;
+                $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading;
+                $stmt_wrapped .= $line;
+              }
+            else
+              {
+                # Should be unreachable, but we don't want an infinite
+                # loop if it can be reached.
+                die;
+              }
+          }
+
+        # Replace the old copyright statement.
+        s/$stmt_re/$stmt_wrapped/;
+      }
+  }
+else
+  {
+    print STDERR "$ARGV: warning: FSF copyright statement not found\n";
+  }
+
+# Local variables:
+# mode: perl
+# 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/gl/Makefile.am b/gl/Makefile.am
index bd6a43e..203a514 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gl/tests --aux-dir=build-aux --with-tests --libtool 
--macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect 
error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 
inet_ntop inet_pton lgpl-2.1 listen maintainer-makefile manywarnings minmax 
perror pmccabe2html progname read-file readline recv select send setsockopt 
shutdown socket sockets sys_stat version-etc-fsf warnings
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gl/tests --aux-dir=build-aux --with-tests --libtool 
--macro-prefix=gl --no-vc-files accept arpa_inet autobuild bind close connect 
error fdl-1.3 gendocs getaddrinfo getline getpass-gnu gnupload gpl-3.0 
inet_ntop inet_pton lgpl-2.1 listen maintainer-makefile manywarnings minmax 
perror pmccabe2html progname read-file readline recv select send setsockopt 
shutdown socket sockets sys_stat update-copyright version-etc-fsf warnings
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -1248,6 +1248,13 @@ EXTRA_DIST += unistd.in.h
 
 ## end   gnulib module unistd
 
+## begin gnulib module update-copyright
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/update-copyright
+
+## end   gnulib module update-copyright
+
 ## begin gnulib module useless-if-before-free
 
 
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 4be0151..c3552d1 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests 
--aux-dir=build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files 
accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo 
getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 listen 
maintainer-makefile manywarnings minmax perror pmccabe2html progname read-file 
readline recv select send setsockopt shutdown socket sockets sys_stat 
version-etc-fsf warnings
+#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests 
--aux-dir=build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files 
accept arpa_inet autobuild bind close connect error fdl-1.3 gendocs getaddrinfo 
getline getpass-gnu gnupload gpl-3.0 inet_ntop inet_pton lgpl-2.1 listen 
maintainer-makefile manywarnings minmax perror pmccabe2html progname read-file 
readline recv select send setsockopt shutdown socket sockets sys_stat 
update-copyright version-etc-fsf warnings
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl/override])
@@ -54,6 +54,7 @@ gl_MODULES([
   socket
   sockets
   sys_stat
+  update-copyright
   version-etc-fsf
   warnings
 ])
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 099a083..9ee2c0a 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -258,6 +258,8 @@ AC_SUBST([LTALLOCA])
   AC_CHECK_FUNCS_ONCE([shutdown])
   abs_aux_dir=`cd "$ac_aux_dir"; pwd`
   AC_SUBST([abs_aux_dir])
+  abs_aux_dir=`cd "$ac_aux_dir"; pwd`
+  AC_SUBST([abs_aux_dir])
   m4_ifval(gltests_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
       for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
@@ -355,6 +357,7 @@ AC_DEFUN([gl_FILE_LIST], [
   build-aux/gnupload
   build-aux/pmccabe.css
   build-aux/pmccabe2html
+  build-aux/update-copyright
   build-aux/useless-if-before-free
   build-aux/vc-list-files
   build-aux/warn-on-use.h
@@ -563,6 +566,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-sys_time.c
   tests/test-time.c
   tests/test-unistd.c
+  tests/test-update-copyright.sh
   tests/test-vasnprintf.c
   tests/test-vc-list-files-cvs.sh
   tests/test-vc-list-files-git.sh
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index 85b6dfb..a3a618c 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -411,6 +411,14 @@ EXTRA_DIST += test-unistd.c
 
 ## end   gnulib module unistd-tests
 
+## begin gnulib module update-copyright-tests
+
+TESTS += test-update-copyright.sh
+TESTS_ENVIRONMENT += PATH='$(abs_aux_dir)'$(PATH_SEPARATOR)"$$PATH"
+EXTRA_DIST += test-update-copyright.sh
+
+## end   gnulib module update-copyright-tests
+
 ## begin gnulib module vasnprintf-tests
 
 TESTS += test-vasnprintf
diff --git a/gl/tests/test-update-copyright.sh 
b/gl/tests/test-update-copyright.sh
new file mode 100755
index 0000000..2d1022a
--- /dev/null
+++ b/gl/tests/test-update-copyright.sh
@@ -0,0 +1,526 @@
+#!/bin/sh
+# Test suite for update-copyright.
+# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# 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/>.
+
+diffout=`diff -u /dev/null /dev/null 2>&1`
+if test x"$diffout" = x"" && test $? -eq 0; then
+  compare() { diff -u "$@"; }
+else
+  compare() { cmp "$@"; }
+fi
+
+TMP_BASE=update-copyright.test
+trap 'rm -f $TMP_BASE*' 0 1 2 3 15
+
+## --------------------------------- ##
+## Skip if user does not have perl.  ##
+## --------------------------------- ##
+
+TMP=$TMP_BASE
+s=$TMP-script
+cat <<\EOF > $s
+eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}'
+  & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
+    if 0;
+s/a/b/
+EOF
+chmod a+x $s
+echo a > $TMP-in
+./$s $TMP-in 2>/dev/null && test b = "`cat $TMP-in 2>/dev/null`" ||
+  {
+    printf '%s\n' "$0: skipping this test;" \
+      'your system has insufficient support for Perl' 1>&2
+    exit 77
+  }
+
+# Do not let a different envvar setting perturb results.
+UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
+export UPDATE_COPYRIGHT_MAX_LINE_LENGTH
+
+## ----------------------------- ##
+## Examples from documentation.  ##
+## ----------------------------- ##
+
+TMP=$TMP_BASE-ex
+cat > $TMP.1 <<EOF
+Copyright @copyright{} 1990-2005, 2007-2009 Free Software
+Foundation, Inc.
+EOF
+cat > $TMP.2 <<EOF
+# Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+cat > $TMP.3 <<EOF
+/*
+ * Copyright &copy; 90,2005,2007-2009
+ * Free Software Foundation, Inc.
+ */
+EOF
+cat > $TMP.4 <<EOF
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+#  Foundation, Inc.
+EOF
+cat > $TMP.5 <<EOF
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+EOF
+cat > $TMP.6 <<EOF
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+#  Foundation, Inc.
+
+Copyright (C) 1990-2005, 2007-2009 Free Software Foundation,
+Inc.
+EOF
+cat > $TMP.7 <<EOF
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+
+# Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+
+rm -f $TMP.*.bak
+UPDATE_COPYRIGHT_YEAR=2009 \
+  update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP.4: warning: FSF copyright statement not found
+$TMP.5: warning: FSF copyright statement not found
+EOF
+compare - $TMP.1 <<EOF || exit 1
+Copyright @copyright{} 1990-2005, 2007-2009 Free Software
+Foundation, Inc.
+EOF
+compare - $TMP.2 <<EOF || exit 1
+# Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+compare - $TMP.3 <<EOF || exit 1
+/*
+ * Copyright &copy; 90,2005,2007-2009
+ * Free Software Foundation, Inc.
+ */
+EOF
+compare - $TMP.4 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+#  Foundation, Inc.
+EOF
+compare - $TMP.5 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+EOF
+compare - $TMP.6 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+#  Foundation, Inc.
+
+Copyright (C) 1990-2005, 2007-2009 Free Software Foundation,
+Inc.
+EOF
+compare - $TMP.7 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+
+# Copyright (C) 1990-2005, 2007-2009 Free Software
+# Foundation, Inc.
+EOF
+
+rm -f $TMP.*.bak
+UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+  update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP.4: warning: FSF copyright statement not found
+$TMP.5: warning: FSF copyright statement not found
+EOF
+compare - $TMP.1 <<EOF || exit 1
+Copyright @copyright{} 1990-2005, 2007-2010 Free Software Foundation,
+Inc.
+EOF
+compare - $TMP.2 <<EOF || exit 1
+# Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
+EOF
+compare - $TMP.3 <<EOF || exit 1
+/*
+ * Copyright &copy; 1990, 2005, 2007-2010 Free Software Foundation, Inc.
+ */
+EOF
+compare - $TMP.4 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+#  Foundation, Inc.
+EOF
+compare - $TMP.5 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+EOF
+compare - $TMP.6 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+#  Foundation, Inc.
+
+Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
+EOF
+compare - $TMP.7 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+
+# Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
+EOF
+
+rm -f $TMP.*.bak
+UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_FORCE=1 \
+  update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP.4: warning: FSF copyright statement not found
+$TMP.5: warning: FSF copyright statement not found
+EOF
+compare - $TMP.1 <<EOF || exit 1
+Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+Free Software Foundation, Inc.
+EOF
+compare - $TMP.2 <<EOF || exit 1
+# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
+# Software Foundation, Inc.
+EOF
+compare - $TMP.3 <<EOF || exit 1
+/*
+ * Copyright &copy; 1990, 2005, 2007, 2008, 2009, 2010 Free Software
+ * Foundation, Inc.
+ */
+EOF
+compare - $TMP.4 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+#  Foundation, Inc.
+EOF
+compare - $TMP.5 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+EOF
+compare - $TMP.6 <<EOF || exit 1
+## Copyright (C) 1990-2005, 2007-2009 Free Software
+#  Foundation, Inc.
+
+Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+EOF
+compare - $TMP.7 <<EOF || exit 1
+Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+
+# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
+# Software Foundation, Inc.
+EOF
+
+rm $TMP*
+
+## -------------- ##
+## Current year.  ##
+## -------------- ##
+
+TMP=$TMP_BASE-current-year
+YEAR=`date +%Y`
+cat > $TMP <<EOF
+'\" Copyright (C) 2006
+'\" Free Software Foundation,
+'\" Inc.
+EOF
+update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+'\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+'\" Copyright (C) 2006, $YEAR Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## ------------------ ##
+## Surrounding text.  ##
+## ------------------ ##
+
+TMP=$TMP_BASE-surrounding-text
+cat > $TMP <<EOF
+    Undisturbed text.
+dnl Undisturbed text.
+dnl Copyright (C) 89
+dnl Free Software Foundation, Inc.
+dnl   Undisturbed text.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+    Undisturbed text.
+dnl Undisturbed text.
+dnl Copyright (C) 1989, 2010 Free Software Foundation, Inc.
+dnl   Undisturbed text.
+EOF
+rm $TMP*
+
+## --------------- ##
+## Widest prefix.  ##
+## --------------- ##
+
+TMP=$TMP_BASE-widest-prefix
+cat > $TMP <<EOF
+#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+#### 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+#### 2008 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984,
+#### 1985, 1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+#### 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+#### Copyright (C) 1976-1988, 1999-2008, 2010-2011 Free Software
+#### Foundation, Inc.
+EOF
+rm $TMP*
+
+## ------------------- ##
+## Prefix too large.  ##
+## ------------------- ##
+
+TMP=$TMP_BASE-prefix-too-large
+cat > $TMP <<EOF
+####  Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+####  1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+####  2008 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP: warning: FSF copyright statement not found
+EOF
+compare - $TMP <<EOF || exit 1
+####  Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+####  1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+####  2008 Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## ------------- ##
+## Blank lines.  ##
+## ------------- ##
+
+TMP=$TMP_BASE-blank-lines
+cat > $TMP <<EOF
+#Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+#
+#1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+#2008 Free Software Foundation, Inc.
+
+Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+
+1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare - $TMP-stderr <<EOF || exit 1
+$TMP: warning: FSF copyright statement not found
+EOF
+compare - $TMP <<EOF || exit 1
+#Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+#
+#1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+#2008 Free Software Foundation, Inc.
+
+Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
+
+1986, 1987, 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## -------------- ##
+## Leading tabs.  ##
+## -------------- ##
+
+TMP=$TMP_BASE-leading-tabs
+cat > $TMP <<EOF
+       Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98,
+        1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
+       Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+       Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
+       1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+       2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+       Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
+       Inc.
+EOF
+rm $TMP*
+
+## -------------------- ##
+## Unusual whitespace.  ##
+## -------------------- ##
+
+TMP=$TMP_BASE-unusual-ws
+cat > $TMP <<EOF
+               # Copyright (C) 87-88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+               # 98, 1999, 2000, 2001, 2002, 2003,                      2004, 
2005, 2006, 2007, 2008,
+               # 2009 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+               # Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994,
+               # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+               # 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+               # Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+               # Copyright (C) 1987-1988, 1991-2011 Free Software
+               # Foundation, Inc.
+EOF
+rm $TMP*
+
+## --------- ##
+## DOS EOL.  ##
+## --------- ##
+
+TMP=$TMP_BASE-dos-eol
+tr @ '\015' > $TMP <<\EOF
+Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
+Rem 98, 1999, 2000, 2001, 2002, 2003,  2004, 2005, 2006, 2007, 2008,@
+Rem 2009 Free Software Foundation, Inc.@
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+tr @ '\015' > $TMP-exp <<\EOF
+Rem Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
+Rem 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@
+Rem 2009, 2010 Free Software Foundation, Inc.@
+EOF
+compare $TMP-exp $TMP || exit 1
+rm $TMP*
+
+## --------------- ##
+## Omitted "(C)".  ##
+## --------------- ##
+
+TMP=$TMP_BASE-omitted-circle-c
+cat > $TMP <<EOF
+  Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+  98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+  2009 Free Software Foundation, Inc.
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+  Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+  1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+  Free Software Foundation, Inc.
+EOF
+rm $TMP*
+
+## ------------------ ##
+## C-style comments.  ##
+## ------------------ ##
+
+TMP=$TMP_BASE-c-style-comments
+cat > $TMP.star <<EOF
+/*  Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ *  98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ *  2009 Free Software Foundation, Inc.  */
+EOF
+cat > $TMP.space <<EOF
+  /*Copyright 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+    98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+    2009 Free Software Foundation, Inc.  */
+EOF
+cat > $TMP.single-line <<EOF
+/*   Copyright 87, 1991, 1992 Free Software Foundation, Inc.  */
+EOF
+cat > $TMP.single-line-wrapped <<EOF
+ /* Copyright 1988, 1991, 1992, 1993 Free Software Foundation, Inc.  */
+EOF
+cat > $TMP.extra-text-star <<EOF
+ /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc.  End
+  * More comments.  */
+EOF
+cat > $TMP.extra-text-space <<EOF
+ /* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. ***
+    * End of comments. */
+EOF
+UPDATE_COPYRIGHT_YEAR=2010 \
+  update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP.star <<EOF || exit 1
+/*  Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ *  1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ *  2009, 2010 Free Software Foundation, Inc.  */
+EOF
+compare - $TMP.space <<EOF || exit 1
+  /*Copyright 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+    1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+    2009, 2010 Free Software Foundation, Inc.  */
+EOF
+compare - $TMP.single-line <<EOF || exit 1
+/*   Copyright 1987, 1991, 1992, 2010 Free Software Foundation, Inc.  */
+EOF
+compare - $TMP.single-line-wrapped <<EOF || exit 1
+ /* Copyright 1988, 1991, 1992, 1993, 2010 Free Software Foundation,
+  * Inc.  */
+EOF
+compare - $TMP.extra-text-star <<EOF || exit 1
+ /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation,
+  * Inc.  End
+  * More comments.  */
+EOF
+compare - $TMP.extra-text-space <<EOF || exit 1
+ /* Copyright 1987, 1988, 1991, 1992, 2010 Free Software Foundation,
+    Inc. ***
+    * End of comments. */
+EOF
+rm $TMP*
+
+exit 0


hooks/post-receive
-- 
GNU gnutls




reply via email to

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