texlive[68114] Build/source/texk/web2c/cwebdir: [CWEB] Accommodate
commits+ascherer at tug.org
commits+ascherer at tug.org
Wed Aug 30 09:28:08 CEST 2023
Revision: 68114
http://tug.org/svn/texlive?view=revision&revision=68114
Author: ascherer
Date: 2023-08-30 09:28:08 +0200 (Wed, 30 Aug 2023)
Log Message:
-----------
[CWEB] Accommodate Perl v5.8.4 on Solaris.
Somehow, the double check (in ctwill.test and in proofsort) for the
availability of module 'Unicode::Collate' succeeds, but the invocation
of creator 'new()' fails.
We try to fix this issue by including both statements in the 'eval'
group, and hope for the best.
(Also, '$progname' must be initialized in the 'BEGIN' group.)
Modified Paths:
--------------
trunk/Build/source/texk/web2c/cwebdir/ChangeLog
trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort
trunk/Build/source/texk/web2c/cwebdir/ctwill.test
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2023-08-29 23:43:34 UTC (rev 68113)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2023-08-30 07:28:08 UTC (rev 68114)
@@ -1,3 +1,8 @@
+2023-08-30 Andreas Scherer <https://ascherer.github.io>
+
+ * ctwill-proofsort,
+ * ctwill.test: Accommodate Perl v5.8.4 on Solaris.
+
2023-08-19 Andreas Scherer <https://ascherer.github.io>
* Makefile,
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort 2023-08-29 23:43:34 UTC (rev 68113)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort 2023-08-30 07:28:08 UTC (rev 68114)
@@ -9,12 +9,17 @@
use Getopt::Long qw(:config no_ignore_case bundling);
use Pod::Usage;
-my $progname = basename $0;
+my $progname;
+my $collator;
BEGIN {
+ $progname = basename $0;
# Unicode::Collate has been around a long time,
# but it's not part of core Perl.
- my $rc = eval { require Unicode::Collate; };
+ my $rc = eval {
+ require Unicode::Collate;
+ $collator = Unicode::Collate->new();
+ };
die "$progname: the Unicode::Collate module is required\n" unless $rc;
}
@@ -52,7 +57,6 @@
my %mini_index; # storage for index entries of a section
my $print_index = 0; # do we collect and print a mini-index?
-my $collator = Unicode::Collate->new();
# Scroll through the input file and look for blocks like
# \mini
@@ -71,7 +75,9 @@
$print_index = 1;
%mini_index = (); # reset mini-index storage
} elsif ("}\\FI\n" eq $line) { # end of mini-index
- foreach my $key ($collator->sort(keys %mini_index)) {
+ foreach my $key ($collator ?
+ $collator->sort(keys %mini_index) :
+ sort {"\L$a" cmp "\L$b"} keys %mini_index) {
print $mini_index{$key};
}
$print_index = 0;
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill.test
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill.test 2023-08-29 23:43:34 UTC (rev 68113)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill.test 2023-08-30 07:28:08 UTC (rev 68114)
@@ -21,7 +21,7 @@
# Test CTWILL-PROOFSORT
# Perl script not available in builddir, and requires Unicode::Collate;
# if that module is not available, just quit testing.
-perl -e 'use Unicode::Collate;' 2>/dev/null || exit 0
+perl -e 'use Unicode::Collate; Unicode::Collate->new();' 2>/dev/null || exit 0
$testdir/../ctwill-proofsort ham.tex > ham-sorted.tex || exit 1
diff ham-sorted.tex $testdir/ham-sorted.tex || exit 1
More information about the tex-live-commits
mailing list.