summaryrefslogtreecommitdiff
path: root/build-aux/update-b4-copyright
diff options
context:
space:
mode:
authorJoel E. Denny <joeldenny@joeldenny.org>2011-01-02 08:17:44 -0500
committerJoel E. Denny <joeldenny@joeldenny.org>2011-01-02 09:16:34 -0500
commitcb3f7f335aa69ba3e6478fea8d4591f4f6d43bc5 (patch)
tree22ef4ca1aaecdbec1aecbbaf4a169a7fbd3801d3 /build-aux/update-b4-copyright
parent1eb6350451be28c3bec08b21711eb6b1cdd6143f (diff)
downloadbison-cb3f7f335aa69ba3e6478fea8d4591f4f6d43bc5.tar.gz
maint: prepare to use date ranges in copyright notices.
* README (Copyright statements): New section explaining the range notation. The GNU coding standards require this explanation. I copied ours from coreutils. * build-aux/update-b4-copyright: Revert 2010-06-17 changes that disabled Bison's automated use of ranges. * cfg.mk (update-copyright-env): Likewise.
Diffstat (limited to 'build-aux/update-b4-copyright')
-rwxr-xr-xbuild-aux/update-b4-copyright17
1 files changed, 13 insertions, 4 deletions
diff --git a/build-aux/update-b4-copyright b/build-aux/update-b4-copyright
index 63a33359..ea82de4f 100755
--- a/build-aux/update-b4-copyright
+++ b/build-aux/update-b4-copyright
@@ -73,10 +73,19 @@ while (/($old_re)/gx)
# Put spaces after commas.
$year_lines =~ s/, ?/, /g;
- # Do not compress to intervals; for example, do not replace
- # "2008, 2009, 2010" with "2008-2010". See the Copyright
- # Notices section in Information for Maintainers of GNU Software, at:
- # http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
+ # 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;