summaryrefslogtreecommitdiff
path: root/build-aux/update-copyright
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-10-14 13:36:44 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-10-14 13:37:43 -0700
commit1ce2386b601b84285c423f1f9545bc2ed6dd420e (patch)
treef7469c961d3f0cc3e25e67ef368c443819180a8b /build-aux/update-copyright
parent82ba8d96586277b6593f2e763229ab721da69d1a (diff)
downloadgnulib-1ce2386b601b84285c423f1f9545bc2ed6dd420e.tar.gz
update-copyright: use en dashes in .texi ranges * build-aux/update-copyright: Update ranges in .tex, .texi, and .texinfo files to use en dashes instead of hyphens.
Diffstat (limited to 'build-aux/update-copyright')
-rwxr-xr-xbuild-aux/update-copyright14
1 files changed, 8 insertions, 6 deletions
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index 89ca9bac96..e4809f620d 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -98,7 +98,7 @@
# 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.
+# commas, "-", or "--". Whitespace may appear after commas.
#
# Environment variables:
#
@@ -231,26 +231,28 @@ if (defined $stmt_re)
# Make the use of intervals consistent.
if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
{
- $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
+ $stmt =~ s/(\d{4})--?(\d{4})/join(', ', $1..$2)/eg;
}
else
{
+ my $ndash = $ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" : "-";
+
$stmt =~
s/
(\d{4})
(?:
- (,\ |-)
+ (,\ |--?)
((??{
- if ($2 eq '-') { '\d{4}'; }
+ if ($2 ne ', ') { '\d{4}'; }
elsif (!$3) { $1 + 1; }
else { $3 + 1; }
}))
)+
- /$1-$3/gx;
+ /$1$ndash$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/;
+ and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1$ndash$2/;
}
# Format within margin.