This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Import gnulib's latest update-copyright script...


... and update our copyright.py script to set environment variable
UPDATE_COPYRIGHT_USE_INTERVALS to '2' instead of '1'.  This tells
the script to collapse all years into one single interval.

This act on a discussion we had at the beginning of the year.
I can also run the script, and transform all the files now.
Or I could get it done at the start of next year, but it will be
combined with the addition of year 2013... I don't have a preference,
whatever is the least amount of pain for everyone.

gdb/ChangeLog:

        * gnulib/extra/update-copyright: Update to the latest from
        gnulib's git repository.
        * copyright.py: Set UPDATE_COPYRIGHT_USE_INTERVALS environment
        variable to 2 instead of 1.

Checked in.

---
 gdb/ChangeLog                     |    7 +++++++
 gdb/copyright.py                  |    7 +++++--
 gdb/gnulib/extra/update-copyright |   13 ++++++++++---
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cb9eecb..2cc117e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-01  Joel Brobecker  <brobecker@adacore.com>
+
+	* gnulib/extra/update-copyright: Update to the latest from
+	gnulib's git repository.
+	* copyright.py: Set UPDATE_COPYRIGHT_USE_INTERVALS environment
+	variable to 2 instead of 1.
+
 2012-02-29  Joel Brobecker  <brobecker@adacore.com>
 
 	* varobj.c (c_value_of_variable): Remove dead code.
diff --git a/gdb/copyright.py b/gdb/copyright.py
index d2df65e..180e7c4 100644
--- a/gdb/copyright.py
+++ b/gdb/copyright.py
@@ -84,8 +84,11 @@ def update_files(update_list):
     # repeat the prefixes in MULTILINE_COMMENT_PREFIXES.
     os.environ['MULTILINE_COMMENT_PREFIXES'] = \
         '\n'.join(MULTILINE_COMMENT_PREFIXES)
-    # We want to use year intervals in the copyright notices.
-    os.environ['UPDATE_COPYRIGHT_USE_INTERVALS'] = '1'
+    # We want to use year intervals in the copyright notices, and
+    # all years should be collapsed to one single year interval,
+    # even if there are "holes" in the list of years found in the
+    # original copyright notice (OK'ed by the FSF, case [gnu.org #719834]).
+    os.environ['UPDATE_COPYRIGHT_USE_INTERVALS'] = '2'
 
     # Perform the update, and save the output in a string.
     update_cmd = ['bash', 'gdb/gnulib/extra/update-copyright'] + update_list
diff --git a/gdb/gnulib/extra/update-copyright b/gdb/gnulib/extra/update-copyright
index d86a12b..082b749 100755
--- a/gdb/gnulib/extra/update-copyright
+++ b/gdb/gnulib/extra/update-copyright
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}'
     if 0;
 # Update an FSF copyright year list to include the current year.
 
-my $VERSION = '2011-01-02.20:59'; # UTC
+my $VERSION = '2012-02-05.21:39'; # UTC
 
 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
 #
@@ -24,7 +24,7 @@ my $VERSION = '2011-01-02.20:59'; # UTC
 
 # The arguments to this script should be names of files that contain
 # copyright statements to be updated.  The copyright holder's name
-# defaults to "Free Softward Foundation, Inc." but may be changed to
+# defaults to "Free Software Foundation, Inc." but may be changed to
 # any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment
 # variable.
 #
@@ -43,7 +43,7 @@ my $VERSION = '2011-01-02.20:59'; # UTC
 # A warning is printed for every file for which no copyright
 # statement is recognized.
 #
-# Each file's copyright statement must be formated correctly in
+# Each file's copyright statement must be formatted correctly in
 # order to be recognized.  For example, each of these is fine:
 #
 #   Copyright @copyright{} 1990-2005, 2007-2009 Free Software
@@ -110,6 +110,9 @@ my $VERSION = '2011-01-02.20:59'; # UTC
 #      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.
+#      If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps
+#      to the minimal containing range.  For example, convert
+#      2000, 2004-2007, 2009 to 2000-2009.
 #   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.
@@ -221,6 +224,10 @@ if (defined $stmt_re)
                   }))
                 )+
               /$1-$3/gx;
+
+            # When it's 2, emit a single range encompassing all year numbers.
+            $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
+              and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
           }
 
         # Format within margin.
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]