texlive[67352] Build/source/texk/web2c/cwebdir: [CWEB] Rename script

commits+ascherer at tug.org commits+ascherer at tug.org
Tue Jun 13 02:22:57 CEST 2023


Revision: 67352
          http://tug.org/svn/texlive?view=revision&revision=67352
Author:   ascherer
Date:     2023-06-13 02:22:57 +0200 (Tue, 13 Jun 2023)
Log Message:
-----------
[CWEB] Rename script later.

Will probably become 'ctwill-proofsort' on build/installation.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog

Added Paths:
-----------
    trunk/Build/source/texk/web2c/cwebdir/proofsort

Removed Paths:
-------------
    trunk/Build/source/texk/web2c/cwebdir/ctproofsort

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2023-06-12 23:43:09 UTC (rev 67351)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2023-06-13 00:22:57 UTC (rev 67352)
@@ -1,6 +1,6 @@
 2023-06-12  Andreas Scherer  <https://ascherer.github.io>
 
-	* ctproofsort: Sort mini-indexes in CTWILL output.
+	* proofsort: Sort mini-indexes in CTWILL output.
 
 2023-05-26  Andreas Scherer  <https://ascherer.github.io>
 

Deleted: trunk/Build/source/texk/web2c/cwebdir/ctproofsort
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctproofsort	2023-06-12 23:43:09 UTC (rev 67351)
+++ trunk/Build/source/texk/web2c/cwebdir/ctproofsort	2023-06-13 00:22:57 UTC (rev 67352)
@@ -1,52 +0,0 @@
-#!/usr/bin/perl
-# This small Perl script 'proofsort' sorts the mini-indexes for each
-# section in the TeX file created by 'ctwill +P', i.e., prior to
-# formatting with the 'proofmac.tex' macros.
-#
-# Example from MMIX:
-# $ tie -c mmotype-twill.ch mmotype.{w,ch} mmotype-mini.ch
-# $ ctwill +P -x mmotype mmotype-twill (run this two times)
-# $ ./proofsort mmotype.tex > mmotype-sorted.tex
-# $ mv mmotype-sorted.tex mmotype.tex
-# $ tex mmotype
-#
-# Public domain.  Originally written by Andreas Scherer, 2023.
-
-use strict;
-use warnings;
-
-# We expect a TeX file as the single command-line parameter.
-die "$0 input_file\n" unless scalar @ARGV;
-
-my $tex=$ARGV[0];
-
-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?
-
-foreach my $line (<TEX>) {
-	chomp($line);
-
-	if ('\\mini' eq $line) { # start of mini-index
-		$print_index=1;
-		%mini_index=(); # reset mini-index
-	} elsif ('}\\FI' eq $line) { # end of mini-index
-		foreach my $key (sort keys %mini_index) {
-			print "$mini_index{$key}\n";
-		}
-		$print_index=0;
-	} elsif ($print_index) { # mini-index entry
-		my ($location,$key) = split / /, $line; # 2nd column is the key
-		$key=~s/\\//g; # strip TeX escape(s)
-		$key=~m/\w*\{(\w+)\}/; # extract plain key
-		$mini_index{$1}=$line; # store index entry
-		next; # print later
-	}
-
-	print "$line\n";
-}
-
-close(TEX);
-
-exit 0;

Copied: trunk/Build/source/texk/web2c/cwebdir/proofsort (from rev 67341, trunk/Build/source/texk/web2c/cwebdir/ctproofsort)
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/proofsort	                        (rev 0)
+++ trunk/Build/source/texk/web2c/cwebdir/proofsort	2023-06-13 00:22:57 UTC (rev 67352)
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+# This small Perl script 'proofsort' sorts the mini-indexes for each
+# section in the TeX file created by 'ctwill +P', i.e., prior to
+# formatting with the 'proofmac.tex' macros.
+#
+# Example from MMIX:
+# $ tie -c mmotype-twill.ch mmotype.{w,ch} mmotype-mini.ch
+# $ ctwill +P -x mmotype mmotype-twill (run this two times)
+# $ ./proofsort mmotype.tex > mmotype-sorted.tex
+# $ mv mmotype-sorted.tex mmotype.tex
+# $ tex mmotype
+#
+# Public domain.  Originally written by Andreas Scherer, 2023.
+
+use strict;
+use warnings;
+
+# We expect a TeX file as the single command-line parameter.
+die "$0 input_file\n" unless scalar @ARGV;
+
+my $tex=$ARGV[0];
+
+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?
+
+foreach my $line (<TEX>) {
+	chomp($line);
+
+	if ('\\mini' eq $line) { # start of mini-index
+		$print_index=1;
+		%mini_index=(); # reset mini-index
+	} elsif ('}\\FI' eq $line) { # end of mini-index
+		foreach my $key (sort keys %mini_index) {
+			print "$mini_index{$key}\n";
+		}
+		$print_index=0;
+	} elsif ($print_index) { # mini-index entry
+		my ($location,$key) = split / /, $line; # 2nd column is the key
+		$key=~s/\\//g; # strip TeX escape(s)
+		$key=~m/\w*\{(\w+)\}/; # extract plain key
+		$mini_index{$1}=$line; # store index entry
+		next; # print later
+	}
+
+	print "$line\n";
+}
+
+close(TEX);
+
+exit 0;



More information about the tex-live-commits mailing list.