summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2023-08-30 07:28:08 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2023-08-30 07:28:08 +0000
commit5193e75fd7de9f38545ee893452923c785c985aa (patch)
tree9bb0d74b86bcdf9dc7760f6bfa302d088ac9b38a /Build/source
parent1b6bb62d4f170aeec48bfe7da5d1a880c815bcf2 (diff)
[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.) git-svn-id: svn://tug.org/texlive/trunk@68114 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/cwebdir/ChangeLog5
-rwxr-xr-xBuild/source/texk/web2c/cwebdir/ctwill-proofsort14
-rwxr-xr-xBuild/source/texk/web2c/cwebdir/ctwill.test2
3 files changed, 16 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog
index b416bc47d68..4fd7c570104 100644
--- a/Build/source/texk/web2c/cwebdir/ChangeLog
+++ b/Build/source/texk/web2c/cwebdir/ChangeLog
@@ -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,
diff --git a/Build/source/texk/web2c/cwebdir/ctwill-proofsort b/Build/source/texk/web2c/cwebdir/ctwill-proofsort
index c347621c4a9..dbf61958fab 100755
--- a/Build/source/texk/web2c/cwebdir/ctwill-proofsort
+++ b/Build/source/texk/web2c/cwebdir/ctwill-proofsort
@@ -9,12 +9,17 @@ use File::Basename;
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 @@ open(TEX, $tex) or die "$0: Could not open input file $tex.\n";
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 @@ foreach my $line (<TEX>)
$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;
diff --git a/Build/source/texk/web2c/cwebdir/ctwill.test b/Build/source/texk/web2c/cwebdir/ctwill.test
index 7d6139af2fd..7944d19c6cc 100755
--- a/Build/source/texk/web2c/cwebdir/ctwill.test
+++ b/Build/source/texk/web2c/cwebdir/ctwill.test
@@ -21,7 +21,7 @@ diff index.tex $testdir/index.tex || exit 1
# 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