# Update b4_copyright invocations or b4_copyright_years definitions to
# include the current year.
-# Copyright (C) 2009 Free Software Foundation, Inc.
-#
+# 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)
(?:
,\s*
(
- \[\s* (?:\d{4}(,\s*|-))* (\d{4}) \s*]
+ \[\s* (?:\d{4}(?:,\s*|-))* (\d{4}) \s*]
)
)?
\)
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.
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.
# 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
+
# Format within margin.
my $year_lines_new;
my $indent = index ($b4_copyright_line, '[');