+2023-06-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ Update \(en in copyright notices
+ * build-aux/update-copyright (ndash_re): New var, matching \(en too.
+ (stmt_remainder_re, stmt): Use it.
+ (stmt): Match year in constructs like "\(en2023".
+ (ndash): Now \(en in man pages.
+
2023-06-17 Bruno Haible <bruno@clisp.org>
gettext: Update to gettext 0.22.
# 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 "--". Whitespace may appear after commas.
+# commas, "-", "--", or "\(en" (for troff). Whitespace may appear
+# after commas.
#
# Environment variables:
#
eval 'exec perl -wSx -0777 -pi "$0" "$@"'
if 0;
-my $VERSION = '2023-01-11.04:24'; # UTC
+my $VERSION = '2023-06-18.01:14'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
my $copyright_re = 'Copyright';
my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©|©)';
+my $ndash_re = '(?:--?|\\\\\(en)';
my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
$holder ||= 'Free Software Foundation, Inc.';
my $prefix_max = 5;
$holder_re =~ s/\s/$ws_re/g;
my $stmt_remainder_re =
"(?:$ws_re$circle_c_re)?"
- . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|--?))*"
+ . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|$ndash_re))*"
. "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
if (/\G$stmt_remainder_re/)
{
if ($final_year != $this_year)
{
# Update the year.
- $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/;
+ $stmt =~ s/(^|[^\d])$final_year_orig\b/$1$final_year, $this_year/;
}
if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
{
# 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})$ndash_re(\d{4})/join(', ', $1..$2)/eg;
}
else
{
- my $ndash = $ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" : "-";
+ my $ndash = ($ARGV =~ /\.tex(i(nfo)?)?$/ ? "--"
+ : $ARGV =~ /\.(\d[a-z]*|man)$/ ? "\\(en"
+ : "-");
$stmt =~
s/
(\d{4})
(?:
- (,\ |--?)
+ (,\ |$ndash_re)
((??{
if ($2 ne ', ') { '\d{4}'; }
elsif (!$3) { $1 + 1; }
# 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$ndash$2/;
+ and $stmt =~ s/(^|[^\d])(\d{4})\b.*(?:[^\d])(\d{4})\b/$1$2$ndash$3/;
}
# Format within margin.