bison-patches
[Top][All Lists]
Advanced

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

maint: fix use of copyright year intervals.


From: Joel E. Denny
Subject: maint: fix use of copyright year intervals.
Date: Fri, 14 Aug 2009 18:54:12 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

I pushed this to branch-2.4.2, branch-2.5, and master.

>From 75ac158b82be1fab5157b140287368165a50ec82 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Fri, 14 Aug 2009 17:05:06 -0400
Subject: [PATCH] maint: fix use of copyright year intervals.

* gnulib: Update.
* bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
as now recommended in gnulib/NEWS.
* build-aux/update-b4-copyright: Fix.
* cfg.mk (update-copyright-env): Configure update-copyright.
---
 ChangeLog                     |    9 +++++++++
 bootstrap.conf                |    2 +-
 build-aux/update-b4-copyright |   32 +++++++++++++++++---------------
 cfg.mk                        |    2 ++
 gnulib                        |    2 +-
 lib/.cvsignore                |    1 +
 lib/.gitignore                |    1 +
 m4/.cvsignore                 |    1 +
 m4/.gitignore                 |    1 +
 9 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4f5d60f..7a37def 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-08-14  Joel E. Denny  <address@hidden>
+
+       maint: fix use of copyright year intervals.
+       * gnulib: Update.
+       * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
+       as now recommended in gnulib/NEWS.
+       * build-aux/update-b4-copyright: Fix.
+       * cfg.mk (update-copyright-env): Configure update-copyright.
+
 2009-08-12  Akim Demaille  <address@hidden>
 
        distcheck: fix.
diff --git a/bootstrap.conf b/bootstrap.conf
index ee7b873..1cef2f0 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -18,7 +18,7 @@
 # gnulib modules used by this package.
 gnulib_modules='
   announce-gen argmatch config-h c-strcase configmake dirname error
-  extensions fopen-safer gendocs getopt gettext git-version-gen hash
+  extensions fopen-safer gendocs getopt-gnu gettext git-version-gen hash
   inttypes javacomp-script javaexec-script maintainer-makefile malloc
   mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul
   strverscmp unistd unistd-safer unlocked-io update-copyright unsetenv
diff --git a/build-aux/update-b4-copyright b/build-aux/update-b4-copyright
index af43407..30c3801 100755
--- a/build-aux/update-b4-copyright
+++ b/build-aux/update-b4-copyright
@@ -42,7 +42,7 @@ my $old_re = <<'EOF'
   (?:
     ,\s*
     (
-      \[\s* (?:\d{4}(,\s*|-))* (\d{4}) \s*]
+      \[\s* (?:\d{4}(?:,\s*|-))* (\d{4}) \s*]
     )
   )?
   \)
@@ -54,8 +54,7 @@ while (/($old_re)/gx)
     my $start = pos() - length ($1);
     my $b4_copyright_line = $2;
     my $year_lines = $3;
-    my $sep = $4 ? $4 : "";
-    my $final_year = $5;
+    my $final_year = $4;
     $year_lines .= ')';
 
     # If there was a second argument, it contains years, so update them.
@@ -65,18 +64,7 @@ while (/($old_re)/gx)
         if ($final_year != $this_year)
           {
             # Update the year.
-            if ($sep eq '-' && $final_year + 1 == $this_year)
-              {
-                $year_lines =~ s/$final_year/$this_year/;
-              }
-            elsif ($sep ne '-' && $final_year + 1 == $this_year)
-              {
-                $year_lines =~ s/$final_year/$final_year-$this_year/;
-              }
-            else
-              {
-                $year_lines =~ s/$final_year/$final_year, $this_year/;
-              }
+            $year_lines =~ s/$final_year/$final_year, $this_year/;
           }
 
         # Normalize all whitespace.
@@ -85,6 +73,20 @@ while (/($old_re)/gx)
         # Put spaces after commas.
         $year_lines =~ s/, ?/, /g;
 
+        # Compress to intervals.
+        $year_lines =~
+          s/
+            (\d{4})
+            (?:
+              (,\ |-)
+              ((??{
+                if    ($2 eq '-') { '\d{4}'; }
+                elsif (!$3)       { $1 + 1;  }
+                else              { $3 + 1;  }
+              }))
+            )+
+          /$1-$3/gx;
+
         # Format within margin.
         my $year_lines_new;
         my $indent = index ($b4_copyright_line, '[');
diff --git a/cfg.mk b/cfg.mk
index 66a2bc6..501e8dc 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -44,3 +44,5 @@ gnulib_dir = $(srcdir)/../../gnulib
 bootstrap-tools = autoconf,automake,flex,gnulib
 
 update-copyright-local = update-b4-copyright
+update-copyright-env = \
+  UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
diff --git a/gnulib b/gnulib
index 109f294..e98f3a0 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 109f2942075bba4454bd92141b1803cf1b79684c
+Subproject commit e98f3a0b6bb91ab0a1bc71b66b92611f9c3d9546
diff --git a/lib/.cvsignore b/lib/.cvsignore
index a9d5823..9cf8ec5 100644
--- a/lib/.cvsignore
+++ b/lib/.cvsignore
@@ -64,6 +64,7 @@ stamp-h1
 stdbool.h
 stdbool.in.h
 stdbool_.h
+stddef.in.h
 stdint.h
 stdint.in.h
 stdint_.h
diff --git a/lib/.gitignore b/lib/.gitignore
index d3f4a0a..61afc48 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -67,6 +67,7 @@
 /stdbool.h
 /stdbool.in.h
 /stdbool_.h
+/stddef.in.h
 /stdint.h
 /stdint.in.h
 /stdint_.h
diff --git a/m4/.cvsignore b/m4/.cvsignore
index eb2f173..e8cf4d8 100644
--- a/m4/.cvsignore
+++ b/m4/.cvsignore
@@ -50,6 +50,7 @@ quote.m4
 quotearg.m4
 setenv.m4
 stdbool.m4
+stddef_h.m4
 stdint.m4
 stdint_h.m4
 stdio-safer.m4
diff --git a/m4/.gitignore b/m4/.gitignore
index 16ced35..810868c 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -50,6 +50,7 @@
 /quotearg.m4
 /setenv.m4
 /stdbool.m4
+/stddef_h.m4
 /stdint.m4
 /stdint_h.m4
 /stdio-safer.m4
-- 
1.5.4.3





reply via email to

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