summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source')
-rwxr-xr-xBuild/source/.github/scripts/build-tl.sh5
-rw-r--r--Build/source/.github/workflows/main.yml4
-rw-r--r--Build/source/texk/kpathsea/ChangeLog9
-rw-r--r--Build/source/texk/kpathsea/texmf.cnf2
-rw-r--r--Build/source/texk/tests/TeXLive/TLUtils.pm4
-rw-r--r--Build/source/texk/texlive/linked_scripts/ChangeLog8
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.am1
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.in1
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/ctan-o-mat/ctan-o-mat21
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/epstopdf/epstopdf.pl10
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/mf2pt1/mf2pt1.pl8
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/pdfjam/pdfjam4
-rw-r--r--Build/source/texk/texlive/linked_scripts/scripts.lst1
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive-extra/texconfig.sh327
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/extractbb.lua249
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texosquery/texosquery4
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/typog/typog-grep.pl166
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/xput/xput520
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/xput/xputserver411
-rw-r--r--Build/source/texk/texlive/windows_wrapper/runscript.tlu30
-rw-r--r--Build/source/texk/upmendex/ChangeLog9
-rwxr-xr-xBuild/source/texk/upmendex/configure22
-rw-r--r--Build/source/texk/upmendex/configure.ac2
-rw-r--r--Build/source/texk/upmendex/fwrite.c40
-rw-r--r--Build/source/texk/web2c/ChangeLog11
-rw-r--r--Build/source/texk/web2c/bibtex.ch14
-rw-r--r--Build/source/texk/web2c/cwebdir/ChangeLog8
-rw-r--r--Build/source/texk/web2c/cwebdir/ctwill-w2c.ch3
-rw-r--r--Build/source/texk/web2c/cwebdir/cwebman-w2c.ch73
-rw-r--r--Build/source/texk/web2c/dvicopy.ch94
-rw-r--r--Build/source/texk/web2c/dvitype.ch7
-rw-r--r--Build/source/texk/web2c/gftodvi.ch7
-rw-r--r--Build/source/texk/web2c/gftopk.ch7
-rw-r--r--Build/source/texk/web2c/gftype.ch9
-rw-r--r--Build/source/texk/web2c/hitexdir/hitex.w25
-rw-r--r--Build/source/texk/web2c/mf.ch7
-rw-r--r--Build/source/texk/web2c/mft.ch7
-rw-r--r--Build/source/texk/web2c/patgen.ch7
-rw-r--r--Build/source/texk/web2c/pktogf.ch7
-rw-r--r--Build/source/texk/web2c/pktype.ch7
-rw-r--r--Build/source/texk/web2c/pltotf.ch7
-rw-r--r--Build/source/texk/web2c/pooltype.ch7
-rw-r--r--Build/source/texk/web2c/tangle.ch7
-rwxr-xr-xBuild/source/texk/web2c/tests/fix-changefile-lines.py155
-rw-r--r--Build/source/texk/web2c/tex.ch30
-rw-r--r--Build/source/texk/web2c/tftopl.ch7
-rw-r--r--Build/source/texk/web2c/vftovp.ch7
-rw-r--r--Build/source/texk/web2c/vptovf.ch7
48 files changed, 779 insertions, 1599 deletions
diff --git a/Build/source/.github/scripts/build-tl.sh b/Build/source/.github/scripts/build-tl.sh
index 9f460685ffd..dde36ebe2b5 100755
--- a/Build/source/.github/scripts/build-tl.sh
+++ b/Build/source/.github/scripts/build-tl.sh
@@ -32,6 +32,11 @@ then
apt-get update -q -y
apt-get install -y --no-install-recommends bash gcc g++ make perl libfontconfig-dev libx11-dev libxmu-dev libxaw7-dev build-essential
;;
+ almalinux)
+ yum update -y
+ yum install -y gcc-toolset-9 fontconfig-devel libX11-devel libXmu-devel libXaw-devel
+ . /opt/rh/gcc-toolset-9/enable
+ ;;
centos)
yum update -y
yum install -y centos-release-scl
diff --git a/Build/source/.github/workflows/main.yml b/Build/source/.github/workflows/main.yml
index 3472666bcc0..8b4972f12b4 100644
--- a/Build/source/.github/workflows/main.yml
+++ b/Build/source/.github/workflows/main.yml
@@ -59,11 +59,11 @@ jobs:
use_qemu: false
buildsys: ubuntu
- tl_name: x86_64-linux
- image: centos:7
+ image: almalinux:8
platform: amd64
ci_build: true
use_qemu: false
- buildsys: centos
+ buildsys: almalinux
- tl_name: x86_64-linuxmusl
image: alpine:3.5
platform: amd64
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index dc1bd95adf3..cbcee62f617 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,12 @@
+2024-07-01 Karl Berry <karl@tug.org>
+
+ * texmf.cnf (shell_escape_commands): restore extractbb,
+ now as a wrapper script that protects against the exploit.
+
+2024-06-29 Karl Berry <karl@tug.org>
+
+ * texmf.cnf (shell_escape_commands): remove extractbb.
+
2024-06-04 Karl Berry <karl@freefriends.org>
* texmf.cnf (MKTEXPK, etc.): adjust values shown to the
diff --git a/Build/source/texk/kpathsea/texmf.cnf b/Build/source/texk/kpathsea/texmf.cnf
index 94d1b999fdf..5df6bd97f9c 100644
--- a/Build/source/texk/kpathsea/texmf.cnf
+++ b/Build/source/texk/kpathsea/texmf.cnf
@@ -660,7 +660,7 @@ repstopdf,\
r-mpost,\
texosquery-jre8,\
-% we'd like to allow:
+% other programs considered:
% dvips - but external commands can be executed, need at least -R1.
% epspdf, ps2pdf, pstopdf - need to respect openout_any,
% and gs -dSAFER must be used and check for shell injection with filenames.
diff --git a/Build/source/texk/tests/TeXLive/TLUtils.pm b/Build/source/texk/tests/TeXLive/TLUtils.pm
index e43a3aac3c9..c2568809888 100644
--- a/Build/source/texk/tests/TeXLive/TLUtils.pm
+++ b/Build/source/texk/tests/TeXLive/TLUtils.pm
@@ -7,7 +7,7 @@ use strict; use warnings;
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 71007 $';
+my $svnrev = '$Revision: 71593 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -2643,7 +2643,7 @@ sub check_file_and_remove {
if (!$checksum && !$checksize) {
tlwarn("$fn_name: neither checksum nor checksize " .
- "available for $xzfile, cannot check integrity");
+ "available for $xzfile, cannot check integrity\n");
return;
}
diff --git a/Build/source/texk/texlive/linked_scripts/ChangeLog b/Build/source/texk/texlive/linked_scripts/ChangeLog
index a62d5920161..53ece8a565f 100644
--- a/Build/source/texk/texlive/linked_scripts/ChangeLog
+++ b/Build/source/texk/texlive/linked_scripts/ChangeLog
@@ -1,3 +1,11 @@
+2024-07-04 Karl Berry <karl@freefriends.org>
+
+ * xput/xput,
+ * xput/xputserver,
+ * xput/,
+ * ctan-o-mat/ctan-o-mat,
+ * texosquery/texosquery: remove leftovers from old pkg installs.
+
2024-03-19 Karl Berry <karl@tug.org>
* Makefile.am (install-data-hook, uninstall-hook): can't use
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am
index ba4e7be48fd..0bd39fbab96 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.am
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.am
@@ -235,6 +235,7 @@ texmf_other_scripts = \
texfindpkg/texfindpkg.lua \
texdoc/texdoc.tlu \
texfot/texfot.pl \
+ texlive/extractbb.lua \
texlive/fmtutil-sys.sh \
texlive/fmtutil-user.sh \
texlive/fmtutil.pl \
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in
index 447f6518ae1..13b8d4046ad 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.in
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.in
@@ -452,6 +452,7 @@ texmf_other_scripts = \
texfindpkg/texfindpkg.lua \
texdoc/texdoc.tlu \
texfot/texfot.pl \
+ texlive/extractbb.lua \
texlive/fmtutil-sys.sh \
texlive/fmtutil-user.sh \
texlive/fmtutil.pl \
diff --git a/Build/source/texk/texlive/linked_scripts/ctan-o-mat/ctan-o-mat b/Build/source/texk/texlive/linked_scripts/ctan-o-mat/ctan-o-mat
deleted file mode 100755
index 3041dc07ad3..00000000000
--- a/Build/source/texk/texlive/linked_scripts/ctan-o-mat/ctan-o-mat
+++ /dev/null
@@ -1,21 +0,0 @@
-#/bin/sh
-##-----------------------------------------------------------------------------
-## This file is part of ctan-o-mat.
-## This program is distributed under BSD-like license. See file LICENSE
-##
-## (c) 2016-2017 Gerd Neugebauer
-##
-## Net: gene@gerd-neugebauer.de
-##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of a 3-clause BSD-like license as stated in the
-## file LICENSE contained in this distribution.
-##
-## You should have received a copy of the LICENSE along with this
-## program; if not, see the repository under http://***.
-##
-##-----------------------------------------------------------------------------
-
-exec perl "$0.pl" "$@"
-
-# \ No newline at end of file
diff --git a/Build/source/texk/texlive/linked_scripts/epstopdf/epstopdf.pl b/Build/source/texk/texlive/linked_scripts/epstopdf/epstopdf.pl
index df768ef815b..1a599650177 100755
--- a/Build/source/texk/texlive/linked_scripts/epstopdf/epstopdf.pl
+++ b/Build/source/texk/texlive/linked_scripts/epstopdf/epstopdf.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
use warnings;
-# $Id: epstopdf.pl 71121 2024-04-29 17:27:25Z karl $
+# $Id: epstopdf.pl 71584 2024-06-21 22:40:28Z karl $
# (Copyright lines below.)
#
# Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,9 @@ use warnings;
#
# emacs-page
#
-my $ver = "2.34";
+my $ver = "2.35";
+# 2024/06/21 2.35 (Karl Berry)
+# * path_sep for OS/2 is also ";".
# 2024/04/29 2.34 (Karl Berry)
# * if --debug is first argument, give more output.
# * do not check for kpsewhich in PATH unless restricted.
@@ -226,7 +228,7 @@ my $ver = "2.34";
### emacs-page
### program identification
my $program = "epstopdf";
-my $ident = '($Id: epstopdf.pl 71121 2024-04-29 17:27:25Z karl $)' . " $ver";
+my $ident = '($Id: epstopdf.pl 71584 2024-06-21 22:40:28Z karl $)' . " $ver";
my $copyright = <<END_COPYRIGHT ;
Copyright 2009-2024 Karl Berry et al.
Copyright 2002-2009 Gerben Wierda et al.
@@ -258,7 +260,7 @@ debug " on_cygwin=$on_cygwin, on_msys=$on_msys";
# Split PATH and use / as directory separator.
#
-my $path_sep = ( ($^O =~ /^MSWin/) ? ';' : ':' ); # not msys
+my $path_sep = ($^O =~ /^(OS2|MSWin)i/) ? ';' : ':'; # not msys
my @pdirs = split($path_sep, $ENV{"PATH"});
# Normalize directory separators to /. Always valid on Windows.
if ($on_windows_or_cygwin) {
diff --git a/Build/source/texk/texlive/linked_scripts/mf2pt1/mf2pt1.pl b/Build/source/texk/texlive/linked_scripts/mf2pt1/mf2pt1.pl
index a9ee8b74fc4..982f8c98bec 100755
--- a/Build/source/texk/texlive/linked_scripts/mf2pt1/mf2pt1.pl
+++ b/Build/source/texk/texlive/linked_scripts/mf2pt1/mf2pt1.pl
@@ -7,7 +7,7 @@
########################################################################
# mf2pt1 #
-# Copyright (C) 2005-2021 Scott Pakin #
+# Copyright (C) 2005-2024 Scott Pakin #
# #
# This program may be distributed and/or modified under the conditions #
# of the LaTeX Project Public License, either version 1.3c of this #
@@ -21,7 +21,7 @@
# version 2006/05/20 or later. #
########################################################################
-our $VERSION = "2.7"; # mf2pt1 version number
+our $VERSION = "2.8"; # mf2pt1 version number
require 5.6.1; # I haven't tested mf2pt1 with older Perl versions
use Cwd;
@@ -161,7 +161,7 @@ my $filedir;
my $filenoext;
my $versionmsg = "mf2pt1 version $VERSION
-Copyright (C) 2005-2021 Scott Pakin
+Copyright (C) 2005-2024 Scott Pakin
This program may be distributed and/or modified under the conditions
of the LaTeX Project Public License, either version 1.3c of this
@@ -1006,9 +1006,9 @@ else {
Open($1);
SelectAll();
RemoveOverlap();
-AddExtrema();
Simplify(0, 2);
CorrectDirection();
+AddExtrema(1);
Simplify(0, 2);
RoundToInt();
AutoHint();
diff --git a/Build/source/texk/texlive/linked_scripts/pdfjam/pdfjam b/Build/source/texk/texlive/linked_scripts/pdfjam/pdfjam
index 814da495996..ff9a0123cdb 100755
--- a/Build/source/texk/texlive/linked_scripts/pdfjam/pdfjam
+++ b/Build/source/texk/texlive/linked_scripts/pdfjam/pdfjam
@@ -1,5 +1,5 @@
#!/bin/sh
-version=3.11
+version=3.12
#########################################################################
## ##
## pdfjam: A shell-script interface to the "pdfpages" LaTeX package ##
@@ -1144,7 +1144,7 @@ do
then
if tty -s ; then
error_exit \
- "tty is connected to connected to stdin, no PDF/JPG/PNG file found" \
+ "tty is connected to stdin, no PDF/JPG/PNG file found" \
$E_NOINPUT
fi
cat > "$uniqueName"
diff --git a/Build/source/texk/texlive/linked_scripts/scripts.lst b/Build/source/texk/texlive/linked_scripts/scripts.lst
index 479473cdf8c..04eacde6e68 100644
--- a/Build/source/texk/texlive/linked_scripts/scripts.lst
+++ b/Build/source/texk/texlive/linked_scripts/scripts.lst
@@ -176,6 +176,7 @@ texdirflatten/texdirflatten
texfindpkg/texfindpkg.lua
texdoc/texdoc.tlu
texfot/texfot.pl
+texlive/extractbb.lua
texlive/fmtutil-sys.sh
texlive/fmtutil-user.sh
texlive/fmtutil.pl
diff --git a/Build/source/texk/texlive/linked_scripts/texlive-extra/texconfig.sh b/Build/source/texk/texlive/linked_scripts/texlive-extra/texconfig.sh
index 93c660d6983..1b1b2b2abe2 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive-extra/texconfig.sh
+++ b/Build/source/texk/texlive/linked_scripts/texlive-extra/texconfig.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: texconfig.sh 53554 2020-01-26 23:58:37Z karl $
+# $Id: texconfig.sh 71679 2024-07-01 17:04:58Z karl $
# texconfig version 3.0
# Originally written by Thomas Esser. Public domain.
# Now maintained as part of TeX Live; correspondence to tex-live@tug.org.
@@ -28,7 +28,7 @@ PATH="$mydir:$PATH"; export PATH
progname=texconfig
# the version string
-version='$Id: texconfig.sh 53554 2020-01-26 23:58:37Z karl $'
+version='$Id: texconfig.sh 71679 2024-07-01 17:04:58Z karl $'
envVars="
AFMFONTS BIBINPUTS BSTINPUTS CMAPFONTS CWEBINPUTS ENCFONTS GFFONTS
@@ -392,52 +392,6 @@ fmgrConfigReplace()
}
###############################################################################
-# setupDvipsPaper(paper)
-# rearranges config.ps to make paper the first paper definition
-#
-setupDvipsPaper()
-{
- setupDvipsPaperChanged=false
- setupDvipsPaperFile=config.ps
- setupDvipsPaperDftPaper=$1
-
- setupTmpDir
- co=`tcfmgr --tmp $tmpdir --cmd co --file $setupDvipsPaperFile`
- if test $? != 0; then
- echo "$progname: setupDvipsPaper co failed for \`$setupDvipsPaperFile'" >&2
- (exit 1); return 1
- fi
- set x $co; shift
- setupDvipsPaperID=$1; setupDvipsPaperCfgFile=$3; setupDvipsPaperOrigFile=$4
-
- ed "$setupDvipsPaperCfgFile" > /dev/null 2>&1 <<-eof
- /@ /ka
- \$a
- @
- .
- /@ $setupDvipsPaperDftPaper /;/@ /-1m'a-1
- \$d
- w
- q
-eof
-
- ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$setupDvipsPaperID"`
- if test $? != 0; then
- echo "$progname: setupDvipsPaper ci failed for \`$setupDvipsPaperFile'" >&2
- (exit 1); return 1
- fi
- case $ci in
- "") :;;
- $lastUpdatedFile)
- setupDvipsPaperChanged=true;;
- *) echo "$progname: updated configuration saved as file \`$ci'" >&2
- setupDvipsPaperChanged=true
- lastUpdatedFile=$ci;;
- esac
- (exit 0); return 0
-}
-
-###############################################################################
# setupModesMfFile(void) - find modes.mf file (with caching)
#
setupModesMfFile()
@@ -571,7 +525,6 @@ tcBatch()
the TeX installation.
Usage: $progname conf (show configuration information)
- $progname dvipdfmx paper PAPER (dvipdfmx paper size)
$progname dvips [OPTION...] (dvips options)
$progname faq (show pointer to TeX Live docs)
$progname findprog PROG... (show locations of PROGs, a la which)
@@ -584,11 +537,9 @@ Usage: $progname conf (show configuration information)
$progname init [FORMAT]... (rebuild FORMATs, or all formats
plus run texlinks and updmap)
$progname mode MODE (set Metafont MODE)
- $progname paper PAPER (set default paper size to PAPER)
$progname pdftex [OPTION]... (pdftex options)
$progname rehash (rebuild ls-R files with mktexlsr)
$progname version (or --version; show version info)
- $progname xdvi paper PAPER (xdvi paper size)
Get more help with:
$progname dvipdfmx
@@ -596,7 +547,6 @@ Get more help with:
$progname font
$progname hyphen
$progname mode
- $progname paper
$progname pdftex
$progname xdvi
@@ -634,37 +584,8 @@ TeX Live home page: <http://tug.org/texlive/>
# texconfig dvipdfmx
dvipdfmx)
- help="Usage: $progname dvipdfmx paper PAPER
-
-Valid PAPER settings:
- letter legal ledger tabloid a4 a3"
- case $2 in
- # texconfig dvipdfmx paper
- paper-list)
- for p in letter legal ledger tabloid a4 a3; do echo $p; done
- ;;
- paper)
- case $3 in
- letter|legal|ledger|tabloid|a4|a3)
- tlmgr dvipdfmx paper $3
- ;;
- # fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";;
- "") echo "$help" >&2; rc=1;;
- *)
- echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfmx paper'" >&2
- echo "$progname: try \`$progname dvipdfmx paper' for help" >&2
- rc=1 ;;
- esac ;;
- # texconfig dvipdfmx ""
- "")
- echo "$help" >&2; rc=1 ;;
- # texconfig dvipdfmx <unknown>
- *)
- echo "$progname: unknown option \`$2' given as argument for \`$progname dvipdfmx'" >&2
- echo "$progname: try \`$progname dvipdfmx' for help" >&2
- rc=1
- ;;
- esac
+ abort "Use tlmgr paper dvipdfmx"
+ rc=1
;;
# texconfig dvips
@@ -672,7 +593,6 @@ Valid PAPER settings:
shift
help="Usage: $progname dvips add PRINTER
$progname dvips del PRINTER
- $progname dvips paper PAPER
$progname dvips [-P PRINTER] mode MODE
$progname dvips [-P PRINTER] offset OFFSET
$progname dvips [-P PRINTER] printcmd CMD"
@@ -779,32 +699,7 @@ Valid PAPER settings:
listDvipsPapers
;;
paper)
- case $2 in
- "")
- echo "Usage: $progname dvips paper PAPER" >&2
- echo >&2; echo "Valid PAPER settings:" >&2
- locateConfigPsFile
- listDvipsPapers | sed 's@ .*@@; s@^@ @' | myFmt
- rc=1
- ;;
- *)
- tcBatchDvipsPaper=$2
- locateConfigPsFile
- case "$configPsFile" in
- "")
- echo "$progname: file config.ps not found" >&2; rc=1
- ;;
- *)
- if grep "@ $tcBatchDvipsPaper " $configPsFile >/dev/null 2>&1; then
- tlmgr dvips paper $tcBatchDvipsPaper
- # setupDvipsPaper "$tcBatchDvipsPaper"
- else
- echo "$progname: paper \`$tcBatchDvipsPaper' not found in file \`$configPsFile'" >&2; rc=1
- fi
- ;;
- esac
- ;;
- esac
+ abort "Use tlmgr paper dvips"
;;
mode)
case $2 in
@@ -876,14 +771,6 @@ Valid MODE settings:"
echo "Please see https://tug.org/texlive/doc/ for the documentation"
echo "available in TeX Live."
;;
- # setupTexmfmain
- # if test -f $MT_TEXMFMAIN/doc/tetex/teTeX-FAQ; then
- # <$MT_TEXMFMAIN/doc/tetex/teTeX-FAQ eval ${PAGER-more}
- # else
- # echo "$progname: faq not found (usually in \$TEXMFMAIN/doc/tetex/teTeX-FAQ)" >&2
- # rc=1
- # fi
- # ;;
findprog)
shift
@@ -1200,104 +1087,11 @@ Valid MODE settings:"
;;
paper)
- help="Usage: $progname paper PAPER
-
-Valid PAPER settings:
- letter a4"
-
- p=$2; pDvips=$2
- case $2 in
- letter|a4) ;;
- "") echo "$help" >&2; rc=1; return;;
- *)
- echo "$progname: unknown PAPER \`$2' given as argument for \`$progname paper'" >&2
- echo "$progname: try \`$progname paper' for help" >&2
- rc=1
- return;;
- esac
- if checkForBinary dvips >/dev/null && tcfmgr --cmd find --file config.ps >/dev/null 2>&1; then
- tcBatch dvips paper $pDvips
- fi
- if checkForBinary dvipdfmx >/dev/null && tcfmgr --cmd find --file dvipdfmx.cfg >/dev/null 2>&1; then
- tcBatch dvipdfmx paper $p
- fi
- if checkForBinary xdvi >/dev/null && tcfmgr --cmd find --file XDvi >/dev/null 2>&1; then
- tcBatch xdvi paper $p
- fi
- if checkForBinary pdftex >/dev/null && tcfmgr --cmd find --file pdftexconfig.tex >/dev/null 2>&1; then
- tcBatch pdftex paper $p
- fi
+ abort "Use tlmgr paper"
;;
pdftex)
- help="Usage: $progname pdftex paper PAPER
-
-Valid PAPER settings:
- a4 letter"
- case $2 in
-
- mode)
- case $3 in
- "")
- echo "Usage: $progname pdftex mode MODE"
- rc=1
- ;;
- *)
- tcBatchPdftexMode=$3
- setupTmpDir
- setupModesMfFile
- if checkElemInList "$tcBatchPdftexMode" `listMfModes | sed 's@ .*@@'`; then
- set x `getRes "$tcBatchPdftexMode"`; shift
- fmgrConfigReplace pdftexconfig.tex 'pdfpkresolution' "\\pdfpkresolution=$1"
- if $fmgrConfigReplaceChanged; then
- fmtutil --refresh
- fi
- else
- echo "$progname: unknown MODE \`$tcBatchPdftexMode' given as argument for \`$progname pdftex mode'" >&2
- rc=1
- fi
- ;;
- esac
- ;;
-
- paper)
- case $3 in
- letter|a4)
- tlmgr pdftex paper $3
- ;;
- #letter)
- # w="8.5 true in"; h="11 true in"
- # setupTmpDir
- # fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w"
- # wChanged=$fmgrConfigReplaceChanged
- # fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h"
- # if $wChanged || $fmgrConfigReplaceChanged; then
- # fmtutil --refresh
- # fi
- # ;;
- #a4)
- # w="210 true mm"; h="297 true mm"
- # fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w"
- # wChanged=$fmgrConfigReplaceChanged
- # fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h"
- # if $wChanged || $fmgrConfigReplaceChanged; then
- # fmtutil --refresh
- # fi
- # ;;
- "") echo "$help" >&2; rc=1;;
- *)
- echo "$progname: unknown PAPER \`$3' given as argument for \`$progname pdftex paper'" >&2
- echo "$progname: try \`$progname pdftex paper' for help" >&2
- rc=1 ;;
- esac ;;
- "")
- echo "$help" >&2; rc=1;;
- *)
- echo "$progname: unknown option \`$2' given as argument for \`$progname pdftex'" >&2
- echo "$progname: try \`$progname pdftex' for help" >&2
- rc=1
- ;;
- esac
+ abort "Use tlmgr paper pdftex"
;;
rehash)
@@ -1314,112 +1108,7 @@ Valid PAPER settings:
# handle "xdvi paper PAPER"
xdvi)
- tcBatchXdviPapers='us "8.5x11"
-letter "8.5x11"
-ledger "17x11"
-tabloid "11x17"
-usr "11x8.5"
-legal "8.5x14"
-legalr "14x8.5"
-foolscap "13.5x17.0"
-foolscapr "17.0x13.5"
-a0 "84.1x118.9cm"
-a1 "59.4x84.1cm"
-a2 "42.0x59.4cm"
-a3 "29.7x42.0cm"
-a4 "21.0x29.7cm"
-a5 "14.8x21.0cm"
-a6 "10.5x14.8cm"
-a7 "7.4x10.5cm"
-a8 "5.2x7.4cm"
-a9 "3.7x5.2cm"
-a10 "2.6x3.7cm"
-a0r "118.9x84.1cm"
-a1r "84.1x59.4cm"
-a2r "59.4x42.0cm"
-a3r "42.0x29.7cm"
-a4r "29.7x21.0cm"
-a5r "21.0x14.8cm"
-a6r "14.8x10.5cm"
-a7r "10.5x7.4cm"
-a8r "7.4x5.2cm"
-a9r "5.2x3.7cm"
-a10r "3.7x2.6cm"
-b0 "100.0x141.4cm"
-b1 "70.7x100.0cm"
-b2 "50.0x70.7cm"
-b3 "35.3x50.0cm"
-b4 "25.0x35.3cm"
-b5 "17.6x25.0cm"
-b6 "12.5x17.6cm"
-b7 "8.8x12.5cm"
-b8 "6.2x8.8cm"
-b9 "4.4x6.2cm"
-b10 "3.1x4.4cm"
-b0r "141.4x100.0cm"
-b1r "100.0x70.7cm"
-b2r "70.7x50.0cm"
-b3r "50.0x35.3cm"
-b4r "35.3x25.0cm"
-b5r "25.0x17.6cm"
-b6r "17.6x12.5cm"
-b7r "12.5x8.8cm"
-b8r "8.8x6.2cm"
-b9r "6.2x4.4cm"
-b10r "4.4x3.1cm"
-c0 "91.7x129.7cm"
-c1 "64.8x91.7cm"
-c2 "45.8x64.8cm"
-c3 "32.4x45.8cm"
-c4 "22.9x32.4cm"
-c5 "16.2x22.9cm"
-c6 "11.4x16.2cm"
-c7 "8.1x11.4cm"
-c8 "5.7x8.1cm"
-c9 "4.0x5.7cm"
-c10 "2.8x4.0cm"
-c0r "129.7x91.7cm"
-c1r "91.7x64.8cm"
-c2r "64.8x45.8cm"
-c3r "45.8x32.4cm"
-c4r "32.4x22.9cm"
-c5r "22.9x16.2cm"
-c6r "16.2x11.4cm"
-c7r "11.4x8.1cm"
-c8r "8.1x5.7cm"
-c9r "5.7x4.0cm"
-c10r "4.0x2.8cm"'
- help="Usage: $progname xdvi paper PAPER
-
-Valid PAPER settings:
- a0 a0r a1 a1r a2 a2r a3 a3r a4 a4r a5 a5r a6 a6r a7 a7r a8 a8r a9 a9r a10 a10r
- b0 b0r b1 b1r b2 b2r b3 b3r b4 b4r b5 b5r b6 b6r b7 b7r b8 b8r b9 b9r b10 b10r
- c0 c0r c1 c1r c2 c2r c3 c3r c4 c4r c5 c5r c6 c6r c7 c7r c8 c8r c9 c9r c10 c10r
- us letter ledger tabloid usr legal legalr foolscap foolscapr"
- case $2 in
- paper-list)
- echo "$tcBatchXdviPapers"
- ;;
- paper)
- case $3 in
- [abc][0-9]|[abc]10|[abc][0-9]r|[abc]10r|us|letter|ledger|tabloid|usr|legal|legalr|foolscap|foolscapr)
- tlmgr xdvi paper $3
- # fmgrConfigReplace XDvi paper: "*paper: $3"
- ;;
- "") echo "$help" >&2; rc=1;;
- *)
- echo "$progname: unknown PAPER \`$3' given as argument for \`$progname xdvi paper'" >&2
- echo "$progname: try \`$progname xdvi paper' for help" >&2
- rc=1 ;;
- esac ;;
- "")
- echo "$help" >&2; rc=1;;
- *)
- echo "$progname: unknown option \`$2' given as argument for \`$progname xdvi'" >&2
- echo "$progname: try \`$progname xdvi' for help" >&2
- rc=1
- ;;
- esac
+ abort "Use tlmgr paper xdvi"
;;
*)
echo "$progname: unknown option \`$1' given as argument for \`$progname'" >&2
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/extractbb.lua b/Build/source/texk/texlive/linked_scripts/texlive/extractbb.lua
new file mode 100755
index 00000000000..6ed6347bb35
--- /dev/null
+++ b/Build/source/texk/texlive/linked_scripts/texlive/extractbb.lua
@@ -0,0 +1,249 @@
+#!/usr/bin/env texlua
+-- $Id: extractbb.lua 71746 2024-07-08 21:16:39Z karl $
+-- SPDX-License-Identifier: CC0-1.0
+-- SPDX-FileCopyrightText: 2024 Max Chernoff
+--
+-- A generic wrapper to make commands safe to run with restricted shell escape.
+--
+-- Originally created for extractbb, which is listed in shell_escape_commands,
+-- but can be run as dvipdfm(x), which in turn can run arbitrary commands
+-- using its -D option.
+--
+-- The idea is to exec "ebb --ebb <other args>", since only argv[1] is
+-- used by dvipdfmx to determine its behavior.
+--
+-- Note: This script can only adjust the paths and arguments of the target
+-- executable; it *CANNOT* make an arbitrary program safe to run with
+-- restricted shell escape.
+
+-- A shorter, less paranoid version.
+-- (Prepend a hyphen to the line below to enable).
+--[=[
+arg[0] = arg[0]:gsub("extractbb", "ebb")
+table.insert(arg, 1, "ebb")
+table.insert(arg, 2, "--ebb")
+os.exec(arg)
+os.exit(1)
+--]=]
+
+---------------------
+--- Configuration ---
+---------------------
+
+-- The base name of this script. (Example: ``extractbb'')
+local SCRIPT_NAME = "extractbb"
+
+-- The extension of the script. Extensionless-names are also permitted.
+-- (Example: ``lua'')
+local SCRIPT_EXT = "lua"
+
+-- The base name of the path to the target program. (Example: ``xdvipdfmx'')
+local TARGET_PATH_NAME = "xdvipdfmx"
+
+-- The name to use when calling the target program. Equivalent to ``argv[0]''
+-- in C. (Example: ``extractbb'')
+local TARGET_EXEC_NAME = "ebb"
+
+-- Any extra arguments to be prepended to the target program, before any
+-- user-supplied arguments. Equivalent to ``argv[1], ...'' in C.
+-- (Example: ``--extractbb'')
+local TARGET_PREPEND_ARGS = { "--extractbb" }
+
+-- Any extra arguments to be appended to the target program, after any
+-- user-supplied arguments. Equivalent to ``..., argv[argc]'' in C.
+local TARGET_APPEND_ARGS = {}
+
+-- Sets the value of ``openin_any'' to this value. If ``nil'', then the value
+-- will be left unchanged. (Example: ``r'')
+local READ_PERMS = "r"
+
+-- Sets the value of ``openout_any'' to this value. If ``nil'', then the value
+-- will be left unchanged. (Example: ``p'')
+local WRITE_PERMS = "p"
+
+-- The name of the Lua interpreter. (Example: ``texlua'')
+local INTERPRETER_NAME = "texlua"
+
+-- The extension of the interpreter. Extensionless-names are also permitted.
+-- (Example: ``exe'')
+local INTERPRETER_EXT = "exe"
+
+
+----------------------
+--- Initialization ---
+----------------------
+
+-- Save often-used globals for a slight speed boost.
+local insert = table.insert
+
+-- Set the kpathsea program name
+kpse.set_program_name(INTERPRETER_NAME, SCRIPT_NAME)
+
+-- Rename the input arguments so we don't get confused
+local script_args = arg
+
+
+----------------------------
+--- Function Definitions ---
+----------------------------
+
+-- Error messages
+local function error(message)
+ io.stderr:write("! ERROR (extractbb.lua): " .. message, "\n")
+ io.stderr:write(debug.traceback(nil, 2), "\n")
+ io.stderr:flush()
+ os.exit(1)
+end
+
+-- Get the directory, name, and extension from a full path. We'll split on
+-- either a forward or backward slash---Windows can use either, and we don't
+-- need to support Unix systems with TL installed to a directory with
+-- backslashes in its name.
+local split_dir_pattern = "^(.*)[/\\]([^/\\]-)$"
+local split_ext_pattern = "(.*)%.([^.]-)$"
+
+local function split_path(path)
+ -- Make sure that we were given a string
+ if type(path) ~= "string" then
+ return nil, nil, nil
+ end
+
+ -- Split the (directory) from the (name and extension)
+ local dir, name_ext = path:match(split_dir_pattern)
+
+ -- No directory
+ if not dir then
+ dir = nil
+ name_ext = path
+
+ -- A bare directory (with a trailing slash)
+ elseif name_ext == "" then
+ return dir, nil, nil
+ end
+
+ -- Split the (name) from the (extension)
+ local name, ext = name_ext:match(split_ext_pattern)
+
+ -- No extension (or a dotfile)
+ if (not name) or (name == "") then
+ name = name_ext
+ ext = nil
+ end
+
+ return dir, name, ext
+end
+
+-- See if a file exists
+local function file_exists(path)
+ local mode = lfs.attributes(path, "mode")
+ return (mode == "file") or (mode == "link")
+end
+
+
+---------------------
+--- Safety Checks ---
+---------------------
+
+-- Make sure that we're running unrestricted.
+if status.shell_escape ~= 1 then
+ error("Shell escape has been disabled.")
+end
+
+if status.safer_option ~= 0 then
+ error("The ``safer'' option has been enabled.")
+end
+
+-- Set the file permissions.
+if READ_PERMS then
+ os.setenv("openin_any", READ_PERMS)
+end
+
+if WRITE_PERMS then
+ os.setenv("openout_any", WRITE_PERMS)
+end
+
+-- Get the directory of the script and interpreter
+local script_path = debug.getinfo(1, "S").source:sub(2)
+local script_dir, script_name, script_ext = split_path(script_path)
+
+local interpreter_dir = kpse.var_value("SELFAUTOLOC")
+local _, interpreter_name, interpreter_ext = split_path(script_args[-1])
+if os.type == 'windows' then
+ interpreter_ext = INTERPRETER_EXT
+end
+-- Look up the script again with kpathsea
+local resolved_script_path = kpse.find_file(
+ script_name .. "." .. (script_ext or SCRIPT_EXT), "texmfscripts", true
+)
+
+-- Make sure that our paths are correct
+if not script_dir then
+ error("Empty script dir")
+end
+
+if not resolved_script_path then
+ error("Empty resolved script path")
+end
+
+-- But on Macs we get /Library/TeX/texbin. What to do?
+-- (Frank msg to tex-live 8jul24.)
+-- if (script_dir ~= interpreter_dir) and (script_path ~= resolved_script_path) then
+-- error("The script is in an incorrect location: " .. script_dir)
+-- end
+
+if script_name ~= SCRIPT_NAME then
+ error("Incorrect script name: " .. script_name)
+end
+
+if interpreter_name ~= INTERPRETER_NAME then
+ error("Incorrect interpreter name: " .. interpreter_name)
+end
+
+if (script_ext ~= SCRIPT_EXT) and (script_ext ~= nil) then
+ error("Incorrect script extension: " .. script_ext)
+end
+
+if (interpreter_ext ~= INTERPRETER_EXT) and (interpreter_ext ~= nil) then
+ error("Incorrect interpreter extension: " .. interpreter_ext)
+end
+
+-- Get the path to the target program
+local target_ext = interpreter_ext and ("." .. interpreter_ext) or ""
+local target_path = interpreter_dir .. "/" .. TARGET_PATH_NAME .. target_ext
+
+-- Make sure that the target program exists
+if not file_exists(target_path) then
+ error("The target program does not exist: " .. target_path)
+end
+
+
+----------------------
+--- Run the target ---
+----------------------
+
+-- Generate the target arguments
+local target_args = {
+ [0] = target_path, -- Path to the executable
+ [1] = TARGET_EXEC_NAME, -- argv[0]
+}
+
+-- argv[2] through argv[n]
+for _, arg in ipairs(TARGET_PREPEND_ARGS) do
+ insert(target_args, arg)
+end
+
+for i = 1, #script_args do
+ -- We use a numeric iterator here to avoid ``arg[-1]'' and ``arg[0]''.
+ insert(target_args, script_args[i])
+end
+
+for _, arg in ipairs(TARGET_APPEND_ARGS) do
+ insert(target_args, arg)
+end
+
+-- Run the target program, replacing the current process
+local _, err = os.exec(target_args)
+
+if err then
+ error("The target program failed to run.")
+end
diff --git a/Build/source/texk/texlive/linked_scripts/texosquery/texosquery b/Build/source/texk/texlive/linked_scripts/texosquery/texosquery
deleted file mode 100755
index 2f97a43db65..00000000000
--- a/Build/source/texk/texlive/linked_scripts/texosquery/texosquery
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar`
-java -jar "$jarpath" "$@"
diff --git a/Build/source/texk/texlive/linked_scripts/typog/typog-grep.pl b/Build/source/texk/texlive/linked_scripts/typog/typog-grep.pl
index bc7f0e98fbd..a3c7bd1aecb 100755
--- a/Build/source/texk/texlive/linked_scripts/typog/typog-grep.pl
+++ b/Build/source/texk/texlive/linked_scripts/typog/typog-grep.pl
@@ -5,6 +5,7 @@ use strict;
use warnings;
use Data::Dumper ();
+use Encode ();
use English;
use File::Basename ();
use Getopt::Long;
@@ -48,32 +49,32 @@ sub limit_string_length {
## We set all colors to `undef' and fill them later with the values
## of the actual configuration.
my $highlight_patterns = {
- PARTIAL_LINE => {
- FONT_SPEC => [qr#
- \\
- (?: OMS | OMX | OT1 | T1 | TS1 | U )
- (?: /[^/]+ ){5} / \S+ \s
- (?: \([+-]\d+\) )?
- #x, undef],
- MATH => [qr#
- \$
- \\
- (?: LMS | OML )
- (?: /[^/]+ ){5} / \S+ \s
- (?: \([+-]\d+\) )?
- .*?
- \$
- #x, undef]
- },
- WHOLE_LINE => {
- FILL_STATE => [qr#^(?:Under|Over)full \\hbox .*$#, undef],
- FIRST_VBOX => [qr#^%%#, undef],
- HORIZONTAL_BREAKPOINT => [qr#^@@\d+:.*$#, undef],
- HORIZONTAL_BREAK_CANDIDATE => [qr#^@[\\ ].*$#, undef],
- LINE_BREAK_PASS => [qr#^@[a-z]+?pass#, undef],
- TIGHTNESS => [qr#^(?:Loose|Tight) \\hbox .*$#, undef],
- VERTICAL_BREAKPOINT => [qr#^% t=\d+.*$#, undef]
- }
+ PARTIAL_LINE => {
+ FONT_SPEC => [qr#
+ \\
+ (?: OMS | OMX | OT1 | T1 | TS1 | U )
+ (?: /[^/]+ ){5} / \S+ \s
+ (?: \([+-]\d+\) )?
+ #x, undef],
+ MATH => [qr#
+ \$
+ \\
+ (?: LMS | OML )
+ (?: /[^/]+ ){5} / \S+ \s
+ (?: \([+-]\d+\) )?
+ .*?
+ \$
+ #x, undef]
+ },
+ WHOLE_LINE => {
+ FILL_STATE => [qr#^(?:Under|Over)full \\hbox .*$#, undef],
+ FIRST_VBOX => [qr#^%%#, undef],
+ HORIZONTAL_BREAKPOINT => [qr#^@@\d+:.*$#, undef],
+ HORIZONTAL_BREAK_CANDIDATE => [qr#^@[\\ ].*$#, undef],
+ LINE_BREAK_PASS => [qr#^@[a-z]+?pass#, undef],
+ TIGHTNESS => [qr#^(?:Loose|Tight) \\hbox .*$#, undef],
+ VERTICAL_BREAKPOINT => [qr#^% t=\d+.*$#, undef]
+ }
};
sub colorize_line {
@@ -84,7 +85,7 @@ sub colorize_line {
return Term::ANSIColor::colored($line, $pattern_color_pair->[1])
if $line =~ $pattern_color_pair->[0];
}
- return $line if $line =~ m#^\.#; # we do not paint box contents yet
+ return $line if $line =~ m#^\.#; # we do not paint box contents yet
$line =~ s#$highlight_patterns->{PARTIAL_LINE}->{MATH}->[0]
#Term::ANSIColor::colored($MATCH, $highlight_patterns->{PARTIAL_LINE}->{MATH}->[1])
@@ -108,13 +109,29 @@ my $open_tag_regexp =
page="(?<page_match> .*?)"
>#x;
+sub find_encoder {
+ my $encoding = shift;
+
+ my $encoder;
+
+ if ($encoding) {
+ $encoder = Encode::find_encoding($encoding);
+ if (!$encoder) {
+ issue_warning("encoding @{[quote_literal($encoding)]} unknown; proceeding without decoder");
+ }
+ }
+
+ return $encoder;
+}
+
sub grep_log_file {
my ($options, $configuration, $file, $filename, $id_regexp) = @_;
+ my $encoder = find_encoder($options->{ENCODING});
my $job_name;
- my $line_number = 0; # line number in the log file we are inspecting, i.e., $filename
+ my $line_number = 0; # line number in the log file we are inspecting, i.e., $filename
my $match_count = 0;
- my $source_line_number; # line number in TeX file the log refers to, i.e., "$job_name.tex"
+ my $source_line_number; # line number in TeX file the log refers to, i.e., "$job_name.tex"
my $page_number;
my $regexp_modifier = $options->{IGNORE_CASE} ? 'i' : '';
my $id_value;
@@ -128,6 +145,8 @@ sub grep_log_file {
chomp $line;
$line_number++;
+ $line = Encode::encode_utf8($encoder->decode($line, Encode::FB_CROAK)) if $encoder;
+
if ($line =~ $close_tag_regexp) {
fail_with_error("$filename: $line_number: mismatched open/close tags") unless @nesting_levels;
pop @nesting_levels;
@@ -209,18 +228,24 @@ sub grep_log_file {
}
}
}
+
+ return $match_count;
}
sub show_ids_in_file {
my ($options, $configuration, $file, $filename, $id_regexp) = @_;
+ my $encoder = find_encoder($options->{ENCODING});
my $line_number = 0;
+ my $match_count = 0;
my @nesting_levels;
while (my $line = readline $file) {
chomp $line;
$line_number++;
+ $line = Encode::encode_utf8($encoder->decode($line, Encode::FB_CROAK)) if $encoder;
+
if ($line =~ $close_tag_regexp) {
fail_with_error("$filename: $line_number: mismatched open/close tags") unless @nesting_levels;
pop @nesting_levels;
@@ -233,6 +258,7 @@ sub show_ids_in_file {
my $page_number = $+{page_match};
++$MATCH_COUNT;
+ ++$match_count;
push @nesting_levels, 1;
if ($options->{LOG_LINE_NUMBER}) {
@@ -272,6 +298,8 @@ sub show_ids_in_file {
print ' ' x $indent, $id_value, "\n";
}
}
+
+ return $match_count;
}
sub open_file_for_reading {
@@ -288,7 +316,7 @@ sub open_file_for_reading {
fail_with_error("cannot open @{[quote_filesystem($filename)]}: $OS_ERROR");
}
- $file;
+ return $file;
}
sub close_file {
@@ -302,15 +330,17 @@ sub grep_or_show {
my ($options, $configuration, $file, $filename, $id_regexp) = @_;
if ($options->{SHOW_ALL_IDS}) {
- show_ids_in_file($options, $configuration, $file, $filename, $id_regexp);
+ return show_ids_in_file($options, $configuration, $file, $filename, $id_regexp);
} else {
- grep_log_file($options, $configuration, $file, $filename, $id_regexp);
+ return grep_log_file($options, $configuration, $file, $filename, $id_regexp);
}
}
sub scan_files {
my ($options, $configuration, $id_regexp, $log_filenames) = @_;
+ my $match_count = 0;
+
if (@$log_filenames) {
foreach my $log_filename (@$log_filenames) {
$log_filename = 'stdin' if $log_filename eq '-';
@@ -323,15 +353,17 @@ sub scan_files {
print $filename_header;
}
my $file = open_file_for_reading($log_filename);
- grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
+ $match_count += grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
close_file($file, $log_filename);
}
} else {
my $log_filename = 'stdin';
my $file = open_file_for_reading($log_filename);
- grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
+ $match_count = grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
close_file($file, $log_filename);
}
+
+ return $match_count;
}
sub redirect_and_scan_files {
@@ -347,10 +379,12 @@ sub redirect_and_scan_files {
my $stdout = select $pager;
$pager->autoflush;
- scan_files($options, $configuration, $id_regexp, $log_filenames);
+ my $match_count = scan_files($options, $configuration, $id_regexp, $log_filenames);
close $pager or issue_warning "error occurred while closing the pager (pid: $pid) pipe: $OS_ERROR";
select $stdout;
+
+ return $match_count;
}
########################################################################
@@ -452,6 +486,7 @@ sub setup_configuation {
my $default_options = {
COLORIZE_MODE => 'auto',
DEBUG => 0,
+ ENCODING => undef,
ID => 0,
IGNORE_CASE => 0,
JOB_NAME => 0,
@@ -472,6 +507,7 @@ Options
--colour [WHEN] use color to highlight specific log contents
WHEN is 'always', 'never', or 'auto'
-C, --config KEY=VALUE set configuration KEY to VALUE
+ -E, --encoding ENCODING set character ENCODING of LOG-FILE
-i, --[no-]id print matching id with output lines
-y, --[no-]ignore-case ignore case distinctions in patterns and data
-j, --[no-]job-name print \\jobname with output lines
@@ -481,10 +517,12 @@ Options
-P, --[no-]pager redirect output to pager
-w, --[no-]word-regexp match only whole words
- -a, --all, --any show all IDs in LOG-FILE
+ -a, --all, --any discover all IDs in LOG-FILE
+
--debug turn on debug output
-h, --help display this help and exit
--show-config show default configuration and exit
+ --show-encodings show all known encodings and exit
-V, --version show version information and exit
HELP_TEXT
@@ -492,6 +530,16 @@ HELP_TEXT
exit 0;
}
+sub show_encodings {
+ my @all_encodings = Encode->encodings(':all');
+
+ foreach my $encoding (@all_encodings) {
+ print "$encoding\n";
+ }
+
+ exit 0;
+}
+
sub show_configuration {
my $format_string_value = sub {quote_literal($default_configuration->{$_[0]})};
@@ -526,10 +574,10 @@ FIXED_CONFIGURATION_TEXT
sub show_version {
print <<VERSION_TEXT;
-typog-grep 0.1
+typog-grep 0.4
Copyright (C) 2024 by Ch. L. Spiel
-License LPPL: LaTeX Project Public License version 1.3 or later
+License LPPL: LaTeX Project Public License version 1.3c or later
VERSION_TEXT
exit 0;
@@ -544,6 +592,7 @@ sub get_options {
'color|colour=s' => \$options->{COLORIZE_MODE},
'C|configuration=s' => sub{setup_configuation($_[1], $configuration)},
'debug+' => \$DEBUG,
+ 'E|encoding=s' => \$options->{ENCODING},
'h|help' => \&show_help,
'i|id!' => \$options->{ID},
'y|ignore-case!' => \$options->{IGNORE_CASE},
@@ -552,13 +601,18 @@ sub get_options {
'N|log-line-number!' => \$options->{LOG_LINE_NUMBER},
'p|page-number!' => \$options->{PAGE_NUMBER},
'P|pager!' => \$options->{REQUEST_PAGER},
+ 'show-encodings' => \&show_encodings,
'show-config' => \&show_configuration,
'V|version' => \&show_version,
'w|word-regexp!' => \$options->{WORD_REGEXP}) or
- fail_with_error('problems while parsing options');
+ fail_with_error('problems while parsing options');
- fail_with_error("unknown colorize mode @{[quote_literal($options->{COLORIZE_MODE})]}")
- unless $options->{COLORIZE_MODE} =~ m/^(?:always|auto|never)$/i
+ if ($options->{COLORIZE_MODE}) {
+ fail_with_error("unknown colorize mode @{[quote_literal($options->{COLORIZE_MODE})]}")
+ unless $options->{COLORIZE_MODE} =~ m/^(?:always|auto|never)$/i;
+ } else {
+ $options->{COLORIZE_MODE} = 'auto';
+ }
}
sub do_colorize {
@@ -579,14 +633,27 @@ sub do_colorize {
sub main {
$OUTPUT_IS_REDIRECTED = -t STDOUT ? 0 : 1;
- my $options = {%$default_options};
my $configuration = {%$default_configuration};
+ my $options = {%$default_options};
+ debug_print(Data::Dumper::Dumper(['Default Configuration', $configuration]));
+ debug_print(Data::Dumper::Dumper(['Default Options', $options]));
+
+ my $user_options = {};
+ my $user_configuration = {};
+ get_options($user_options, $user_configuration);
+ debug_print(Data::Dumper::Dumper(['User Configuration', $user_configuration]));
+ debug_print(Data::Dumper::Dumper(['User Options', $user_options]));
+ while (my ($key, $value) = each %$user_options) {
+ $options->{$key} = $value if $value;
+ }
+ while (my ($key, $value) = each %$user_configuration) {
+ $configuration->{$key} = $value if $value;
+ }
+ debug_print(Data::Dumper::Dumper(['Final Configuration', $configuration]));
+ debug_print(Data::Dumper::Dumper(['Final Options', $options]));
- get_options($options, $configuration);
$options->{COLORIZE_OUTPUT} = do_colorize($options->{COLORIZE_MODE});
initialize_highlighting_from_configuration($configuration);
- debug_print(Data::Dumper::Dumper($configuration));
- debug_print(Data::Dumper::Dumper($options));
my $id_regexp;
if ($options->{SHOW_ALL_IDS}) {
@@ -598,17 +665,18 @@ sub main {
$id_regexp = shift @ARGV;
}
- if ($options->{REQUEST_PAGER} && $OUTPUT_IS_REDIRECTED) {
+ if ($user_options->{REQUEST_PAGER} && $OUTPUT_IS_REDIRECTED) {
issue_warning("option @{[quote_literal('--pager')]} ignored because output is redirected");
}
my $use_pager = $options->{REQUEST_PAGER} && !$OUTPUT_IS_REDIRECTED;
+ my $match_count;
if ($use_pager) {
- redirect_and_scan_files($options, $configuration, $id_regexp, \@ARGV);
+ $match_count = redirect_and_scan_files($options, $configuration, $id_regexp, \@ARGV);
} else {
- scan_files($options, $configuration, $id_regexp, \@ARGV);
+ $match_count = scan_files($options, $configuration, $id_regexp, \@ARGV);
}
- exit ($MATCH_COUNT == 0);
+ exit ($match_count == 0);
}
main();
diff --git a/Build/source/texk/texlive/linked_scripts/xput/xput b/Build/source/texk/texlive/linked_scripts/xput/xput
deleted file mode 100755
index 57203c7a5da..00000000000
--- a/Build/source/texk/texlive/linked_scripts/xput/xput
+++ /dev/null
@@ -1,520 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2022 by Friedemann Bartels
-#
-# This file may be distributed and/or modified under the
-# conditions of the LaTeX Project Public License, either
-# version 1.3c of this license or (at your option) any later
-# version. The latest version of this license is in:
-#
-# http://www.latex-project.org/lppl.txt
-#
-# and version 1.3c or later is part of all distributions of
-# LaTeX version 2008/05/04 or later.
-#
-
-version=1.0.2
-
-OK="$( tput setaf 2 )•$( tput sgr0 )"
-FAILED="$( tput setaf 1 )$( tput bold )x$( tput sgr0 )"
-NEW="$( tput setaf 3 )$( tput bold )+$( tput sgr0 )"
-REMOVED="$( tput setaf 5 )$( tput bold )-$( tput sgr0 )"
-ERROR="$( tput setaf 1 )$( tput bold )!$( tput sgr0 )"
-
-_playok() {
- if [ -f /System/Library/Sounds/Glass.aiff ]; then
- afplay /System/Library/Sounds/Glass.aiff >/dev/null 2>&1
- fi
-}
-
-_playhm() {
- if [ -f /System/Library/Sounds/Basso.aiff ]; then
- afplay /System/Library/Sounds/Basso.aiff >/dev/null 2>&1
- fi
-}
-
-_playerror() {
- if [ -f /System/Library/Sounds/Sosumi.aiff ]; then
- afplay /System/Library/Sounds/Sosumi.aiff >/dev/null 2>&1
- fi
-}
-
-_gettime() {
- if command -v gdate &> /dev/null; then
- echo $( gdate +%s%3N )
- else
- if command -v date &> /dev/null; then
- milliseconds=$( date +%3N )
- if [ $milliseconds = 3N ]; then
- echo $(( SECONDS * 1000 ))
- else
- echo $( date +%s%3N )
- fi
- else
- echo $(( SECONDS * 1000 ))
- fi
- fi
-}
-
-_starttimer() {
- starttime=$( _gettime )
-}
-
-_stoptimer() {
- endtime=$( _gettime )
-
- elapsedtime=$(( endtime - starttime ))
- elapsedseconds=$(( elapsedtime / 1000 ))
- elapsedmilliseconds=$(( elapsedtime % 1000 ))
- elapsed=$elapsedseconds.$( printf "%03d" "$elapsedmilliseconds" )
-}
-
-test() {
- _starttimer
- tmpdir=$( mktemp -d 2>/dev/null )/textest$( date "+%Y%m%d%H%M%S" )$RANDOM
- mkdir $tmpdir
-
- if [ $3 = true ] && [ -d cache ]; then
- rm -rf cache
- fi
-
- okcount=0
- failedcount=0
- newcount=0
- removedcount=0
- fileokcount=0
- filefailedcount=0
- defaultfiller=23
-
- echo ""
- for entry in *$5*.tex
- do
- if [ $entry != "*$5*.tex" ]; then
- name=$( echo $entry | sed -e 's/\.tex$//g' )
- if [ ${name:0:1} != _ ]; then
- printf "$( tput sgr0 )$name"
-
- runtwice=0
- if [ "${name:$(( ${#name} - 2 )):2}" = "@2" ]; then
- runtwice=1
- fi
-
- if [ "$4" != "xelatex" ]; then
- name="$name.$4"
- fi
-
- passed=1
- rm -f $name.failed.*
-
- cp $entry $tmpdir/$name.tex
- shell=""
- if [ $1 = true ]; then
- shell="--shell-escape"
- fi
- $4 -interaction=batchmode $shell --output-directory $tmpdir $tmpdir/$name.tex > /dev/null
- if [ $? -eq 1 ]; then
- passed=0
- fi
- if [ $runtwice -eq 1 ]; then
- $4 -interaction=batchmode $shell --output-directory $tmpdir $tmpdir/$name.tex > /dev/null
- if [ $? -eq 1 ]; then
- passed=0
- fi
- fi
-
- magick convert -density $2 -quiet $tmpdir/$name.pdf $tmpdir/$name.png
- if [ -f "$tmpdir/$name.png" ]; then
- mv $tmpdir/$name.png $tmpdir/$name-0.png
- fi
-
- if [ -f "$name.approved.pdf" ]; then
- magick convert -density $2 -quiet $name.approved.pdf $tmpdir/$name.approved.png
- if [ -f "$tmpdir/$name.approved.png" ]; then
- mv $tmpdir/$name.approved.png $tmpdir/$name.approved-0.png
- fi
- fi
-
- if [ $passed -eq 0 ]; then
- filler=$(( defaultfiller - ${#name} - 2 ))
- else
- filler=$(( defaultfiller - ${#name} ))
- fi
- while [ 0 -le $filler ]; do
- printf " "
- filler=$(( filler - 1 ))
- done
- if [ $passed -eq 0 ]; then
- printf " $ERROR"
- fi
-
- index=0
- while [ -f "$tmpdir/$name-$index.png" ]; do
- if [ -f "$tmpdir/$name.approved-$index.png" ]; then
- changedpixels=$( magick compare -quiet -metric AE $tmpdir/$name-$index.png $tmpdir/$name.approved-$index.png null: 2>&1 )
- if [ $changedpixels -eq 0 ]; then
- okcount=$(( okcount + 1 ))
- printf " $OK"
- else
- failedcount=$(( failedcount + 1 ))
- passed=0
- printf " $FAILED"
- magick compare -quiet $tmpdir/$name-$index.png $tmpdir/$name.approved-$index.png $name.failed.$(( index + 1 )).png
- if [ -f "$tmpdir/$name.pdf" ]; then
- mv $tmpdir/$name.pdf $name.failed.pdf
- fi
- fi
- else
- newcount=$(( newcount + 1 ))
- passed=0
- printf " $NEW"
- mv $tmpdir/$name-$index.png $name.failed.$(( index + 1 )).png
- if [ -f "$tmpdir/$name.pdf" ]; then
- mv $tmpdir/$name.pdf $name.failed.pdf
- fi
- fi
- index=$(( index + 1 ))
- if [ `expr $index % 20` -eq 0 ] && [ -f "$tmpdir/$name-$index.png" ]; then
- echo ""
- filler=$defaultfiller
- while [ 0 -le $filler ]; do
- printf " "
- filler=$(( filler - 1 ))
- done
- fi
- done
- while [ -f "$tmpdir/$name.approved-$index.png" ]; do
- removedcount=$(( removedcount + 1 ))
- passed=0
- printf " $REMOVED"
- mv $tmpdir/$name.approved-$index.png $name.failed.$(( index + 1 )).png
- if [ -f "$tmpdir/$name.pdf" ]; then
- mv $tmpdir/$name.pdf $name.failed.pdf
- fi
- index=$(( index + 1 ))
- if [ `expr $index % 20` -eq 0 ] && [ -f "$tmpdir/$name.approved-$index.png" ]; then
- echo ""
- filler=$defaultfiller
- while [ 0 -le $filler ]; do
- printf " "
- filler=$(( filler - 1 ))
- done
- fi
- done
-
- if [ $passed -eq 1 ]; then
- fileokcount=$(( fileokcount + 1 ))
- else
- filefailedcount=$(( filefailedcount + 1 ))
- fi
-
- echo ""
- fi
- fi
- done
-
- rm -rf $tmpdir
- _stoptimer
- seconds=$( printf "%.1f" "$elapsed" )
-
- filecount=$(( fileokcount + filefailedcount ))
-
- if [ $filecount -gt 0 ]; then
- echo ""
- fi
- if [ $filecount -eq $fileokcount ]; then
- if [ $filecount -eq 0 ]; then
- _playhm &
- echo "$( tput sgr0 )Tested 0 files 🧐."
- else
- _playok &
- echo "$( tput sgr0 )Successfully tested $filecount files in $seconds seconds 🎉."
- fi
- echo ""
- else
- _playerror &
- echo "$( tput sgr0 )Tested $filecount files in $seconds seconds."
- echo ""
-
- if [ $fileokcount -gt 0 ]; then
- filler=$(( 6 + ${#filecount} - ${#fileokcount} ))
- while [ 0 -le $filler ]; do
- printf " "
- filler=$(( filler - 1 ))
- done
- printf "$( tput setaf 2 )$fileokcount OK$( tput sgr0 )"
- echo ""
- fi
- if [ $filefailedcount -gt 0 ]; then
- filler=$(( 6 + ${#filecount} - ${#filefailedcount} ))
- while [ 0 -le $filler ]; do
- printf " "
- filler=$(( filler - 1 ))
- done
- printf "$( tput setaf 1 )$filefailedcount Failed$( tput sgr0 )"
- echo ""
- fi
- echo ""
- exit 1
- fi
-}
-
-approve() {
- filecount=0
-
- suffix=""
- if [ "$1" != "xelatex" ]; then
- suffix=".$1"
- fi
-
- echo ""
- for entry in *$2*$suffix.failed.pdf
- do
- if [ $entry != "*$2*$suffix.failed.pdf" ]; then
- filecount=$(( filecount + 1 ))
- name=$( echo $entry | sed -e "s/$suffix.failed.pdf//" )
- echo $name
- rm -f $name$suffix.approved.pdf
- if [ -f "$name.aux" ]; then
- cp $name$suffix.failed.pdf $name$suffix.approved.pdf
- else
- mv $name$suffix.failed.pdf $name$suffix.approved.pdf
- fi
-
- rm -f $name$suffix.failed.*
- fi
- done
-
- if [ $filecount -gt 0 ]; then
- echo ""
- fi
- if [ $filecount -eq 1 ]; then
- echo "Approved 1 file."
- else
- echo "Approved $filecount files."
- fi
- echo ""
-}
-
-compare() {
- filea=$2
- fileb=$3
- tmpdir=$( mktemp -d 2>/dev/null)/textest$( date "+%Y%m%d%H%M%S" )$RANDOM
- mkdir $tmpdir
-
- namea=$( echo $filea | sed -e 's/\.\///g' | sed -e 's/\.pdf$//g' )
- nameb=$( echo $fileb | sed -e 's/\.\///g' | sed -e 's/\.pdf$//g' )
- basenamea=$(basename $namea)
- basenameb=$(basename $nameb)
-
- rm -f $namea.diff.*.png
-
- spacer=""
- if [ -f "$filea" ]; then
- if [ -f "$fileb" ]; then
- magick convert -density $1 -quiet $filea $tmpdir/$basenamea.png
- if [ -f "$tmpdir/$basenamea.png" ]; then
- mv $tmpdir/$basenamea.png $tmpdir/$basenamea-0.png
- fi
- magick convert -density $1 -quiet $fileb $tmpdir/$basenameb.png
- if [ -f "$tmpdir/$basenameb.png" ]; then
- mv $tmpdir/$basenameb.png $tmpdir/$basenameb-0.png
- fi
-
- index=0
- while [ -f "$tmpdir/$basenamea-$index.png" ]; do
- if [ -f "$tmpdir/$basenameb-$index.png" ]; then
- changedpixels=$( magick compare -quiet -metric AE $tmpdir/$basenamea-$index.png $tmpdir/$basenameb-$index.png null: 2>&1 )
- if [ $changedpixels -eq 0 ]; then
- printf "$spacer$OK"
- spacer=" "
- else
- printf "$spacer$FAILED"
- spacer=" "
- magick compare -quiet $tmpdir/$basenamea-$index.png $tmpdir/$basenameb-$index.png $namea.diff.$(( index + 1 )).png
- fi
- else
- printf "$spacer$NEW"
- spacer=" "
- fi
- index=$(( index + 1 ))
- done
- while [ -f "$tmpdir/$basenameb-$index.png" ]; do
- printf "$spacer$REMOVED"
- spacer=" "
- index=$(( index + 1 ))
- done
- echo ""
- else
- echo "File $fileb not found."
- fi
- else
- echo "File $filea not found."
- fi
-
- rm -rf $tmpdir
-}
-
-perf() {
- if [ -f $4 ]; then
- tmpdir=$( mktemp -d 2>/dev/null )/textestperf$( date "+%Y%m%d%H%M%S" )$RANDOM
- mkdir $tmpdir
- basename=$(basename $4)
-
- if [ $1 = true ] && [ -d cache ]; then
- rm -rf cache
- fi
-
- cp $4 $tmpdir
- shell=""
- if [ $2 = true ]; then
- shell="--shell-escape"
- fi
- _starttimer
- $3 -interaction=batchmode $shell --output-directory $tmpdir $tmpdir/$basename > /dev/null
- _stoptimer
- echo "$elapsed"
-
- rm -rf $tmpdir
- else
- echo "File $4 not found."
- fi
-}
-
-usage() {
- cat <<HELP_USAGE
-usage: xput test [-cs] [-e ENGINE] [-d DENSITY] [PATTERN]
- xput approve [-e ENGINE] [PATTERN]
- xput compare [-d DENSITY] FILE FILE
- xput perf [-cs] [-e ENGINE] FILE
- xput --help
- xput --version
-
- -c clear cache
- -s enable shell escape
- -d DENSITY density in ppi (default 72)
- -e ENGINE latex engine (default xelatex)
-
- Running \`xput test\` creates pdf files for all tex files matching the
- pattern and performs a visual regression test. If no pattern is specified,
- all files in the current directory are tested except for files whose names
- begin with an underscore.
-
- Running \`xput approve\` replaces the reference files with the test files.
-
- Running \`xput compare\` creates a visual diff for two pdf files.
-
- Running \`xput perf\` measures the time for creating a pdf file from the
- given tex file.
-
- Running \`xput --help\` returns this man page.
-
- Running \`xput --version\` returns the Xput version.
-HELP_USAGE
-}
-
-case "$1" in
-test)
- shift
-
- density=72
- shell=false
- clear=false
- engine=xelatex
-
- while getopts ":e:d:sc" arg; do
- case "${arg}" in
- c)
- clear=true
- ;;
- d)
- density="${OPTARG}"
- ;;
- e)
- engine="${OPTARG}"
- ;;
- s)
- shell=true
- ;;
- ?)
- echo "Invalid option: -${OPTARG}."
- ;;
- esac
- done
-
- shift "$(( OPTIND - 1 ))"
-
- test $shell $density $clear $engine $1
- ;;
-approve)
- shift
- engine=xelatex
-
- while getopts ":e:" arg; do
- case "${arg}" in
- e)
- engine="${OPTARG}"
- ;;
- ?)
- echo "Invalid option: -${OPTARG}."
- ;;
- esac
- done
-
- shift "$(( OPTIND - 1 ))"
-
- approve $engine $1
- ;;
-compare)
- shift
-
- density=72
-
- while getopts ":d:" arg; do
- case "${arg}" in
- d)
- density="${OPTARG}"
- ;;
- ?)
- echo "Invalid option: -${OPTARG}."
- ;;
- esac
- done
-
- shift "$(( OPTIND - 1 ))"
-
- compare $density $1 $2
- ;;
-perf)
- shift
-
- shell=false
- clear=false
- engine=xelatex
-
- while getopts ":e:sc" arg; do
- case "${arg}" in
- c)
- clear=true
- ;;
- e)
- engine="${OPTARG}"
- ;;
- s)
- shell=true
- ;;
- ?)
- echo "Invalid option: -${OPTARG}."
- ;;
- esac
- done
-
- shift "$(( OPTIND - 1 ))"
-
- perf $clear $shell $engine $1
- ;;
---version)
- echo Xput $version
- ;;
-*)
- usage
-esac
diff --git a/Build/source/texk/texlive/linked_scripts/xput/xputserver b/Build/source/texk/texlive/linked_scripts/xput/xputserver
deleted file mode 100755
index 8e2baac919a..00000000000
--- a/Build/source/texk/texlive/linked_scripts/xput/xputserver
+++ /dev/null
@@ -1,411 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2022 by Friedemann Bartels
-#
-# This file may be distributed and/or modified under the
-# conditions of the LaTeX Project Public License, either
-# version 1.3c of this license or (at your option) any later
-# version. The latest version of this license is in:
-#
-# http://www.latex-project.org/lppl.txt
-#
-# and version 1.3c or later is part of all distributions of
-# LaTeX version 2008/05/04 or later.
-#
-
-version=1.0.2
-
-_convert() {
- turbo=$1
- filename=$2
- filenamecache=$3
- fileextcache=$4
- originalwidthsp=$5
- originalheightsp=$6
- originalcropleftsp=$7
- originalcroprightsp=$8
- originalcroptopsp=$9
- originalcropbottomsp=${10}
- density=${11}
- displaywidth=${12}
- displayheight=${13}
- resizethreshold=${14}
- unsharp=${15}
- quality="${16}"
-
- mkdir -p cache/"$filenamecache"
- originalwidth=$( magick identify -ping -format %w "$filename" )
- originalheight=$( magick identify -ping -format %h "$filename" )
- width=$(( (10 * originalwidth * (originalwidthsp - originalcropleftsp - originalcroprightsp) / originalwidthsp + 5) / 10 ))
- height=$(( (10 * originalheight * (originalheightsp - originalcroptopsp - originalcropbottomsp) / originalheightsp + 5) / 10 ))
- cropleft=$(( (10 * originalwidth * originalcropleftsp / originalwidthsp + 5) / 10 ))
- croptop=$(( (10 * originalheight * originalcroptopsp / originalheightsp + 5) / 10 ))
- resizewidth=$(( (10 * displaywidth * 100 * density / 473628672 + 5) / 10 ))
- if [ $(( resizewidth * resizethreshold / 100 )) -gt $width ]; then
- resizewidth=$width
- resizeheight=$height
- else
- resizeheight=$(( resizewidth * height / width + 1 ))
- fi
-
- x="x"
- if [ $turbo = 1 ]; then
- export MAGICK_THREAD_LIMIT=1
- fi
- if [ "$quality" != "" ]; then
- quality="-quality $quality"
- fi
- if [ "$unsharp" != "" ]; then
- unsharp="-unsharp $unsharp"
- fi
-
- magick "$filename" -crop $width$x$height+$cropleft+$croptop -resize $resizewidth$x$resizeheight $unsharp $quality "cache/$filenamecache/.g$fileextcache"
- mv "cache/$filenamecache/.g$fileextcache" "cache/$filenamecache/g$fileextcache"
-}
-
-_startbatchprocess() {
- success=0
- for file in cache/*; do
- if [ -f "$file" ]; then
- success=1
- name=$( basename "${file}" )
- mv "$file" "cache/.$name" 2> /dev/null
- if [ $? -eq 0 ]; then
- line=$(head -n 1 "cache/.$name")
-
- IFS="%"
- set -- $line
- IFS=" "
- _convert 1 "$@"
-
- rm "cache/.$name"
- break
- fi
- fi
- done
-
- if [ $success -eq 1 ]; then
- _startbatchprocess
- fi
-}
-
-getwidth() {
- if command -v magick >/dev/null 2>&1; then
- filename=$1
-
- originalwidth=$( magick identify -ping -format %w "$filename" )
- echo $originalwidth
- else
- echo errormagicknotinstalled
- fi
-}
-
-optimize() {
- if command -v magick >/dev/null 2>&1; then
- filenamecache=$2
- fileextcache=$3
-
- if [ -f cache/"$filenamecache" ]; then
- mv cache/"$filenamecache" cache/."$filenamecache" 2> /dev/null
- if [ $? -eq 0 ]; then
- line=$(head -n 1 "cache/.$filenamecache")
-
- IFS="%"
- set -- $line
- IFS=" "
- _convert 1 "$@"
-
- rm "cache/.$filenamecache"
- else
- while [ ! -f cache/"$filenamecache"/g"$fileextcache" ]; do
- sleep 0.05
- done
- fi
- elif [ -d cache/"$filenamecache" ]; then
- while [ ! -f cache/"$filenamecache"/g"$fileextcache" ]; do
- sleep 0.05
- done
- else
- _convert 0 "$@"
- fi
-
- echo ok
- else
- echo errormagicknotinstalled
- fi
-}
-
-makeshadow() {
- if command -v magick >/dev/null 2>&1; then
- filename=$1
- stdDeviation=$2
- opacity=$3
- fill=$4
- width=$5
- height=$6
- framewidth=$7
- frameheight=$8
- frameborder=$9
- frameradius=${10}
-
- [ ! -d cache ] && mkdir cache
- mkdir -p cache/$filename
- echo "<?xml version='1.0' encoding='UTF-8' standalone='no'?>
- <svg
- width='$width'
- height='$height'
- version='1.1'
- xmlns='http://www.w3.org/2000/svg'
- xmlns:svg='http://www.w3.org/2000/svg'>
- <defs>
- <filter
- style='color-interpolation-filters:sRGB'
- id='blur'
- x='-4'
- y='-4'
- width='8'
- height='8'>
- <feGaussianBlur
- stdDeviation='$stdDeviation' />
- </filter>
- </defs>
- <rect
- style='filter:url(#blur);opacity:$opacity;fill:$fill'
- width='$framewidth'
- height='$frameheight'
- x='$frameborder'
- y='$frameborder'
- rx='$frameradius'
- ry='$frameradius' />
- </svg>
- " > cache/$filename/s.svg
- inkscape cache/$filename/s.svg --export-dpi=600 --export-filename cache/$filename/s.pdf
- rm cache/$filename/s.svg
-
- echo ok
- else
- echo errorinkscapenotinstalled
- fi
-}
-
-import() {
- if [ -d import ]; then
- importdir=import
- elif [ "$XPUT_IMPORT_DIRECTORY" != "" ]; then
- if [ -d "$XPUT_IMPORT_DIRECTORY" ]; then
- importdir="$XPUT_IMPORT_DIRECTORY"
- else
- echo $XPUT_IMPORT_DIRECTORY
- exit
- fi
- else
- echo errornoimportdir
- exit
- fi
-
- defaultdirectory=$( echo $1 | sed -e 's/^{//g' | sed -e 's/}{.*//g' )
- directorylist=$( echo $1 | sed -e 's/^{//g' | sed -e 's/}$//g' | sed -e 's/}{/$/g' )
-
- for entry in "$importdir"/*.*
- do
- if [ -f "$entry" ]; then
- name=$( basename "${entry}" )
- if [ "$directorylist" != "" ]; then
- echo "$directorylist" | tr '$' '\n' | while read directory; do
- if [ -f "$directory$name" ]; then
- mv "$entry" "$directory"
- fi
- done
- fi
- if [ -f "$entry" ]; then
- if [ -d "$defaultdirectory" ]; then
- mv "$entry" "$defaultdirectory"
- else
- mv "$entry" .
- fi
- fi
- cachename=$( echo "$name" | sed -e 's/\.[a-zA-Z]*$//g' )
- rm -rf cache/"$cachename"*
- fi
- done
-}
-
-startturbo() {
- file="$(echo $1 | sed -e 's/\.pdflatex$//g')"
- if [ -f $file.tex ]; then
- tmpdir=$( mktemp -d 2>/dev/null )/xputturbo$( date "+%Y%m%d%H%M%S" )$RANDOM
- mkdir $tmpdir
-
- cp $file.tex $tmpdir/xputturbobatchoptimizexyz.tex
-
- command=$(echo $(ps -p $PPID -o command ))
- engine=$(echo $command | sed -e 's/^[A-Z ]*//g' | sed -e 's/ .*//g' | tr -d '\n')
-
- case "$command" in
- *-shell-escape*)
- shellescape="--shell-escape"
- ;;
- esac
-
- if [ "$engine" = "xelatex" ]; then
- nopdf="-no-pdf"
- fi
-
- $engine $shellescape -interaction=batchmode $nopdf --output-directory $tmpdir $tmpdir/xputturbobatchoptimizexyz.tex > /dev/null
-
- rm -rf $tmpdir
- fi
-}
-
-batchoptimize() {
- [ ! -d cache ] && mkdir cache
-
- length=$(( $# / 15 ))
- cores=$( nproc )
- [ $cores -gt $length ] && cores=$length
-
- while [ $length -gt 0 ]; do
- filenamecache="$2"
-
- if [ ! -e cache/"$filenamecache" ]; then
- index=0
- while [ $index -lt 15 ]; do
- if [ $index -eq 0 ]; then
- item="$1"
- else
- item="$item%$1"
- fi
-
- shift
- index=$(( index + 1 ))
- done
-
- echo $item > cache/"$filenamecache"
- else
- shift 15
- fi
-
- length=$(( length - 1 ))
- done
-
- cores=$(( cores - 1 ))
- while [ $cores -gt 0 ]; do
- _startbatchprocess &
- sleep 0.01
- cores=$(( cores - 1 ))
- done
-}
-
-usage() {
- cat <<HELP_USAGE
-This script is intended for internal use of the Xput LaTeX class.
-
-usage: xputserver getwidth % FILE
- xputserver optimize % FILE % FILENAME % EXTENSION % ORIGINALWIDTH % ORIGINALHEIGHT % CROPLEFT % CROPRIGHT % CROPTOP % CROPBOTTOM % DENSITY % WIDTH % HEIGHT % DOWNSAMPLETHRESHOLD % UNSHARP % QUALITY
- xputserver makeshadow % FILENAME % STANDARDDEVIATION % OPACITY % COLOR % WIDTH % HEIGHT % FRAMEWIDTH % FRAMEHEIGHT % MARGIN % BORDERRADIUS
- xputserver start [% import % [GRAPHICSPATH]] [% turbo % JOBNAME]
- xputserver batchoptimize % BATCHLIST
- xputserver --help
- xputserver --version
-
- FILE filename with extension (eg. IMG1234.JPEG)
- FILENAME filename without extension (eg. IMG1234)
- EXTENSION optimized file extension (.jpg|.png)
- DENSITY density in ppi (eg. 72)
- DOWNSAMPLETHRESHOLD downsample threshold (integer >= 100)
- UNSHARP unsharp filter (eg. 2x1)
- QUALITY quality (integer > 0, <= 100)
- STANDARDDEVIATION standard deviation (decimal > 0.0)
- OPACITY opacity (decimal >= 0.0, <= 1.0)
- COLOR color string (eg. pink)
- GRAPHICSPATH list of directories (eg. {images/}{tmp/})
- JOBNAME LaTeX filename without extension (eg. my-document)
- BATCHLIST a flat list of batch items where each batch item is
- a flat list of the 15 parameters required by the
- command \`xputserver optimize\`
-
- All other parameters are length dimensions.
- The command \`xputserver optimize\` expects integer values in the LaTeX
- unit sp (eg. 65536).
- The command \`xputserver makeshadow\` expects decimal values in a SVG
- compatible unit (eg. 420.0pt).
-
- Running \`xputserver getwidth\` returns the width in pixels for the given
- image file.
-
- Running \`xputserver optimize\` creates a cropped, rezised, sharpend and
- compressed image and stores it in the cache directory.
-
- Running \`xputserver makeshadow\` creates a shadow image and stores it in
- the cache directory.
-
- Running \`xputserver start\` with the import parameter triggers the image
- import (see xputmanual.pdf chapter "Image Optimization").
- Running the command with the parameter turbo, where the jobname is the
- filename of the Xput document, processes the document in a special batch
- mode, that creates a batch list and calls the command
- \`xputserver batchoptimize\`.
-
- Running \`xputserver batchoptimize\` optimizes multiple images in parallel.
-
- Running \`xputserver --help\` returns this man page.
-
- Running \`xputserver --version\` returns the Xput version.
-HELP_USAGE
-}
-
-if [ "$1" = --version ]; then
- echo Xput Server $version
- exit
-fi
-
-input=$( echo "$@" | sed -e 's/\\//g' | sed -e 's/ %/%/g' | sed -e 's/% /%/g' )
-IFS="%"
-set -- $input
-IFS=" "
-
-case "$1" in
-getwidth)
- shift
-
- getwidth "$1"
- ;;
-optimize)
- shift
-
- optimize "$@"
- ;;
-makeshadow)
- shift
-
- makeshadow "$@"
- ;;
-start)
- shift
-
- if [ "$1" = "import" ]; then
- shift
-
- import "$1"
-
- shift
- fi
-
- if [ "$1" = "turbo" ]; then
- shift
-
- startturbo "$1" &
- fi
-
- echo ok
- ;;
-batchoptimize)
- shift
-
- batchoptimize "$@" &
-
- echo ok
- ;;
-*)
- usage
-esac
diff --git a/Build/source/texk/texlive/windows_wrapper/runscript.tlu b/Build/source/texk/texlive/windows_wrapper/runscript.tlu
index 97bd77d5436..d6f5ef23c95 100644
--- a/Build/source/texk/texlive/windows_wrapper/runscript.tlu
+++ b/Build/source/texk/texlive/windows_wrapper/runscript.tlu
@@ -1,7 +1,7 @@
-local svnrevision = string.match("$Revision: 71041 $", "%d+") or "0"
-local svndate = string.match("$Date: 2024-04-23 12:33:27 +0200 (Tue, 23 Apr 2024) $", "[-%d]+") or "2009-12-04"
+local svnrevision = string.match("$Revision: 71447 $", "%d+") or "0"
+local svndate = string.match("$Date: 2024-06-06 09:46:11 +0200 (Thu, 06 Jun 2024) $", "[-%d]+") or "2009-12-04"
local bannerstr = "runscript wrapper utility (rev. " ..
svnrevision .. ", " .. svndate .. ")\n" ..
"usage: runscript script-name [arguments]\n" ..
@@ -41,15 +41,16 @@ local helpstr = [[
The following script types and their file extensions are currently
supported and searched in that order:
- Lua (.tlu;.texlua;.lua) -- included
- Perl (.pl) -- included
- Ruby (.rb) -- requires installation
- Python (.py) -- requires installation
- Tcl (.tcl) -- included (GUI scripts only)
- Java (.jar) -- requires installation
- VBScript (.vbs) -- part of Windows
- JScript (.js) -- part of Windows
- Batch (.bat;.cmd) -- part of Windows
+ Lua (.tlu;.texlua;.lua) -- included
+ Perl (.pl) -- included
+ Ruby (.rb) -- requires installation
+ Python (.py) -- requires installation
+ Tcl (.tcl) -- included (GUI scripts only)
+ Java (.jar) -- requires installation
+ Powershell (.ps1) -- part of Windows
+ VBScript (.vbs) -- part of Windows
+ JScript (.js) -- part of Windows
+ Batch (.bat;.cmd) -- part of Windows
Finally, Unix-style extensionless scripts are searched as last and
the interpreter program is established based on the she-bang (#!)
@@ -744,16 +745,19 @@ local extension_map = {
['.py' ] = {'python.exe'},
['.rb' ] = {'ruby.exe'},
['.tcl'] = {'tclsh.exe tclsh86.exe tclsh85.exe tclkitsh.exe'},
+ ['.ps1'] = {'powershell.exe', '-NoLogo', '-ExecutionPolicy', 'Bypass', '-file'},
['.vbs'] = {'cscript.exe', '-nologo'},
}
if guimode then
- -- for GUI mode wrappers we try GUI mode interpeters where possible
+ -- for GUI mode wrappers we try GUI mode interpreters where possible
extension_map['.jar'][1] = 'javaw.exe ' .. extension_map['.jar'][1]
extension_map['.pl' ][1] = 'wperl.exe ' .. extension_map['.pl' ][1]
extension_map['.py' ][1] = 'pythonw.exe ' .. extension_map['.py' ][1]
extension_map['.rb' ][1] = 'rubyw.exe ' .. extension_map['.rb' ][1]
-- gui tcl shares no interpreters with non-gui tcl
extension_map['.tcl'] = {'wish.exe wish86.exe wish85.exe tclkit.exe'}
+ extension_map['.ps1'] = {'powershell.exe', '-NoLogo', '-ExecutionPolicy', 'Bypass',
+ '-WindowStyle', 'hidden', '-file'}
extension_map['.vbs'][1] = 'wscript.exe ' .. extension_map['.vbs'][1]
end
extension_map['.cmd'] = extension_map['.bat']
@@ -850,7 +854,7 @@ end
if not ARGV then
os.setenv('TEXMF', TEXMFDIST)
- local extlist = '.lua;.tlu;.pl;.rb;.py;.tcl;.jar;.vbs;.js;.bat;.cmd;.texlua;\0'
+ local extlist = '.lua;.tlu;.pl;.rb;.py;.tcl;.jar;.ps1;.vbs;.js;.bat;.cmd;.texlua;\0'
local progfullname = search_path(progname, BINDIR, '.lua;.tlu;.bat;.cmd;.pl') or
find_texmfscript(progname, extlist)
os.setenv('TEXMF', nil)
diff --git a/Build/source/texk/upmendex/ChangeLog b/Build/source/texk/upmendex/ChangeLog
index e0f393401a5..915386bdba0 100644
--- a/Build/source/texk/upmendex/ChangeLog
+++ b/Build/source/texk/upmendex/ChangeLog
@@ -1,3 +1,12 @@
+2024-07-06 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * version 1.09 Stable version.
+ * configure.ac: Bump version.
+ * fwrite.c:
+ Improve heading of Ö,ö,Ő,ő,Ü,ü,Ű,ű in Hungarian.
+ Thanks to @hair-splitter for the report.
+ https://github.com/t-tk/upmendex-package/issues/10
+
2024-03-10 Karl Berry <karl@tug.org>
* TL'24 release.
diff --git a/Build/source/texk/upmendex/configure b/Build/source/texk/upmendex/configure
index 136902fe013..4bf75bcd968 100755
--- a/Build/source/texk/upmendex/configure
+++ b/Build/source/texk/upmendex/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for upmendex (TeX Live) 1.08.
+# Generated by GNU Autoconf 2.72 for upmendex (TeX Live) 1.09.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
@@ -611,8 +611,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='upmendex (TeX Live)'
PACKAGE_TARNAME='upmendex--tex-live-'
-PACKAGE_VERSION='1.08'
-PACKAGE_STRING='upmendex (TeX Live) 1.08'
+PACKAGE_VERSION='1.09'
+PACKAGE_STRING='upmendex (TeX Live) 1.09'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1378,7 +1378,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures upmendex (TeX Live) 1.08 to adapt to many kinds of systems.
+'configure' configures upmendex (TeX Live) 1.09 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1450,7 +1450,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of upmendex (TeX Live) 1.08:";;
+ short | recursive ) echo "Configuration of upmendex (TeX Live) 1.09:";;
esac
cat <<\_ACEOF
@@ -1576,7 +1576,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-upmendex (TeX Live) configure 1.08
+upmendex (TeX Live) configure 1.09
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2280,7 +2280,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by upmendex (TeX Live) $as_me 1.08, which was
+It was created by upmendex (TeX Live) $as_me 1.09, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -9209,7 +9209,7 @@ fi
# Define the identity of the package.
PACKAGE='upmendex--tex-live-'
- VERSION='1.08'
+ VERSION='1.09'
# Some tools Automake needs.
@@ -19626,7 +19626,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-upmendex (TeX Live) config.lt 1.08
+upmendex (TeX Live) config.lt 1.09
configured by $0, generated by GNU Autoconf 2.72.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -21833,7 +21833,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by upmendex (TeX Live) $as_me 1.08, which was
+This file was extended by upmendex (TeX Live) $as_me 1.09, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21901,7 +21901,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-upmendex (TeX Live) config.status 1.08
+upmendex (TeX Live) config.status 1.09
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/texk/upmendex/configure.ac b/Build/source/texk/upmendex/configure.ac
index 82d837e124c..f894413d41d 100644
--- a/Build/source/texk/upmendex/configure.ac
+++ b/Build/source/texk/upmendex/configure.ac
@@ -8,7 +8,7 @@ dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
-AC_INIT([upmendex (TeX Live)],[1.08])
+AC_INIT([upmendex (TeX Live)],[1.09])
AC_PREREQ([2.71])
AC_CONFIG_SRCDIR([main.c])
AC_CONFIG_AUX_DIR([../../build-aux])
diff --git a/Build/source/texk/upmendex/fwrite.c b/Build/source/texk/upmendex/fwrite.c
index a0077199ab6..ed528406da6 100644
--- a/Build/source/texk/upmendex/fwrite.c
+++ b/Build/source/texk/upmendex/fwrite.c
@@ -787,9 +787,9 @@ static void index_normalize(UChar *istr, UChar *ini, int *chset)
UChar ch,src[2],dest[8],strX[4],strY[4],strZ[4];
UChar32 c32;
UErrorCode perr;
- UCollationResult order;
+ UCollationResult order,order1;
UCollationStrength strgth;
- static int i_y_mode=0;
+ static int i_y_mode=0,o_o_mode=0,u_u_mode=0;
ch=istr[0];
*chset=charset(istr);
@@ -1012,6 +1012,42 @@ static void index_normalize(UChar *istr, UChar *ini, int *chset)
return;
}
}
+ if (ch==0x0D6||ch==0x0F6||ch==0x150||ch==0x151) {
+ /* check Ö,ö versus Ő,ő for Hungarian */
+ if (o_o_mode==0) {
+ strgth = ucol_getStrength(icu_collator);
+ ucol_setStrength(icu_collator, UCOL_PRIMARY);
+ strX[0] = 0x0D6; strX[1] = 0x00; /* Ö */
+ strY[0] = 0x150; strY[1] = 0x00; /* Ő */
+ strZ[0] = 0x04F; strZ[1] = 0x00; /* O */
+ order = ucol_strcoll(icu_collator, strY, -1, strX, -1);
+ order1 = ucol_strcoll(icu_collator, strZ, -1, strX, -1);
+ o_o_mode = (order==UCOL_EQUAL && order1!=UCOL_EQUAL) ? 2 : 1;
+ ucol_setStrength(icu_collator, strgth);
+ }
+ if (o_o_mode==2) {
+ ini[0] = 0x0D6; /* Ö */
+ return;
+ }
+ }
+ if (ch==0x0DC||ch==0x0FC||ch==0x170||ch==0x171) {
+ /* check Ü,ü versus Ű,ű for Hungarian */
+ if (u_u_mode==0) {
+ strgth = ucol_getStrength(icu_collator);
+ ucol_setStrength(icu_collator, UCOL_PRIMARY);
+ strX[0] = 0x0DC; strX[1] = 0x00; /* Ü */
+ strY[0] = 0x170; strY[1] = 0x00; /* Ű */
+ strZ[0] = 0x055; strZ[1] = 0x00; /* U */
+ order = ucol_strcoll(icu_collator, strY, -1, strX, -1);
+ order1 = ucol_strcoll(icu_collator, strZ, -1, strX, -1);
+ u_u_mode = (order==UCOL_EQUAL && order1!=UCOL_EQUAL) ? 2 : 1;
+ ucol_setStrength(icu_collator, strgth);
+ }
+ if (u_u_mode==2) {
+ ini[0] = 0x0DC; /* Ü */
+ return;
+ }
+ }
if (ch==0x0C6||ch==0x0E6||ch==0x152||ch==0x153||ch==0x132||ch==0x133
||ch==0x0DF||ch==0x1E9E||ch==0x13F||ch==0x140||ch==0x149||ch==0x490||ch==0x491) {
strX[0] = u_toupper(ch); strX[1] = 0x00; /* ex. "Æ" "Œ" */
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 543468fd749..a6cb59db599 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,14 @@
+2024-06-28 Andreas Scherer <https://ascherer.github.io>
+
+ * cwebdir/ctwill-w2c.ch,
+ * tests/fix-changefile-lines.py,
+ * tex.ch: Simpler check for 'change section'.
+
+2024-06-24 Andreas Scherer <https://ascherer.github.io>
+
+ * tests/fix-changefile-lines.py,
+ * bibtex.ch: Update a few tags.
+
2024-06-15 Andreas Scherer <https://ascherer.github.io>
* tests/fix-changefile-lines.py,
diff --git a/Build/source/texk/web2c/bibtex.ch b/Build/source/texk/web2c/bibtex.ch
index 7bda21d2b1a..c8d566ee60b 100644
--- a/Build/source/texk/web2c/bibtex.ch
+++ b/Build/source/texk/web2c/bibtex.ch
@@ -1054,7 +1054,7 @@ if (last_cite = max_cites) then
% [141] Don't pad with blanks, terminate with null.
% Don't use a path to search for subsidiary aux files,
% but do check the directory of the main .aux file.
-%
+%
% This last is useful, for example, when --output-dir is used with TeX and the
% .aux file has an \@input directive resulting from a LaTeX \include;
% see bibtex-auxinclude.test. It's necessary because BibTeX itself does
@@ -1065,7 +1065,7 @@ if (last_cite = max_cites) then
% changing the add_extension function to look for those overrides to the
% aux file dirname, so that when we call kpse_*_name_ok below, we're
% calling it on the actual file that will be used.
-%
+%
% And we need to call kpse_*_name_ok because bibtex is included in the
% shell_escape_commands list that can be invoked by TeX in restricted mode.
%
@@ -1299,7 +1299,7 @@ while (single_ptr + wiz_def_ptr > wiz_fn_space) do
@!cite_info : ^str_number; {extra |cite_list| info}
@z
-@x [224] Be silent unless verbose.
+@x [223] Be silent unless verbose.
print ('Database file #',bib_ptr+1:0,': ');
print_bib_name;@/
@y
@@ -1445,7 +1445,7 @@ entry_strs := XTALLOC ((num_ent_strs + 1) * (num_cites + 1) * (ent_str_size + 1)
x_entry_strs(str_ent_ptr)(0) := end_of_string;
@z
-@x [291] Dynamic lit_stk_size.
+@x [290] Dynamic lit_stk_size.
@!lit_stack : array[lit_stk_loc] of integer; {the literal function stack}
@!lit_stk_type : array[lit_stk_loc] of stk_type; {their corresponding types}
@y
@@ -1478,7 +1478,7 @@ entry_strs := XTALLOC ((num_ent_strs + 1) * (num_cites + 1) * (ent_str_size + 1)
end;
@z
-@x [320] Dynamic buf_size.
+@x [322] Dynamic buf_size.
if (out_buf_length+(p_ptr2-p_ptr1) > buf_size) then
overflow('output buffer size ',buf_size);
@y
@@ -1494,7 +1494,7 @@ while (out_buf_length+(p_ptr2-p_ptr1) > buf_size) do
confusion ('field_info index is out of range');
@z
-@x [330] Macroize entry_strs[][]
+@x [329] Macroize entry_strs[][]
while (entry_strs[str_ent_ptr][ex_buf_ptr] <> end_of_string) do
{copy characters into the buffer}
append_ex_buf_char (entry_strs[str_ent_ptr][ex_buf_ptr]);
@@ -1622,7 +1622,7 @@ if (pop_lit2 >= cmd_str_ptr) then {no shifting---merely change pointers}
@z
% emacs-page
-@x [468] System-dependent changes.
+@x [467] System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \BibTeX\ work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog
index d770c50051a..caf15f71051 100644
--- a/Build/source/texk/web2c/cwebdir/ChangeLog
+++ b/Build/source/texk/web2c/cwebdir/ChangeLog
@@ -1,3 +1,11 @@
+2024-07-10 Andreas Scherer <https://ascherer.github.io>
+
+ * cwebman-w2c.ch: Add link to WEB manual (and line numbers).
+
+2024-07-06 Andreas Scherer <https://ascherer.github.io>
+
+ * cwebman-w2c.ch: Add extra macros for HiTeX.
+
2024-06-09 Andreas Scherer <https://ascherer.github.io>
* comm-w2c.ch,
diff --git a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
index de038897845..cd7862e9be2 100644
--- a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
@@ -1072,11 +1072,10 @@ flush_buffer(out_ptr,false,false);
default: err_print(_("! Improper macro definition")); break;
@z
-@x [12.236] l.4370
+@x [12.237] l.4370
@ @<Start a format...@>= {
doing_format=true;
@y
-
@ @<Start a format...@>= {
doing_format=true;
is_macro=false;
diff --git a/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch b/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch
index 1dc3b30b340..0b9c6156840 100644
--- a/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch
@@ -16,14 +16,15 @@
@q Please send comments, suggestions, etc. to tex-k@@tug.org. @>
-@x
+@x l.4
\input cwebmac
\pdffalse\acrohintfalse
@y
\input cwebmac
+\ifhint \input hiplainpage \fi
@z
-@x
+@x l.6
\def\page{\box255 } \normalbottom
@y
\let\page=\pagebody \raggedbottom
@@ -32,7 +33,7 @@
\advance\footnotecount by 1\relax}
@z
-@x
+@x l.32
\outer\def\section #1.{\penalty-500\bigskip
\centerline{\sectionfont\def\.##1{{\twelvett##1}} #1}\nobreak\vskip 6pt
\everypar{\hskip-\parindent\everypar{}}}
@@ -92,21 +93,21 @@
\fi}
@z
-@x
+@x l.38
\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 4.11)}
@y
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}}
\def\runninghead{{\tentt CWEB} USER MANUAL (Version 4.11 [\TeX~Live])}
@z
-@x
+@x l.52
\vskip 18pt\centerline{(Version 4.11 --- December 2023)}
@y
\vskip 18pt\centerline{(Version 4.11 --- December 2023)%
\footnote*{This document describes the extended \.{CWEB} (Version 4.11 [\TeX~Live]).}}
@z
-@x
+@x l.83
Internet page \.{http://www-cs-faculty.stanford.edu/\char`\~knuth/cweb.html}
@y
Internet page
@@ -114,7 +115,7 @@ Internet page
{http://www-cs-faculty.stanford.edu/\TILDE/knuth/cweb.html}
@z
-@x
+@x l.88
\.{https://github.com/ascherer/cweb} with the really current news.
@y
\pdfURL{\.{https://github.com/ascherer/cweb}}%
@@ -122,7 +123,7 @@ Internet page
with the really current news.
@z
-@x
+@x l.106
should be sent to the \TeX-related mailing list \.{tex-k@tug.org}.
@y
should be sent to the \TeX-related mailing list
@@ -130,7 +131,15 @@ should be sent to the \TeX-related mailing list
{mailto:tex-k@tug.org}.
@z
-@x
+@x l.108
+Readers who are familiar with Knuth's memo ``The \.{WEB} System of Structured
+Documentation'' will be able
+@y
+Readers who are familiar with Knuth's memo ``\pdfURL{The \.{WEB} System of
+Structured Documentation}{../web/webman.pdf}'' will be able
+@z
+
+@x l.527
email address in a \.{CWEB} file (e.g., \.{tex-k@@tug.org}).
@y
email address in a \.{CWEB} file (e.g.,
@@ -138,7 +147,7 @@ email address in a \.{CWEB} file (e.g.,
{mailto:tex-k@tug.org}).
@z
-@x
+@x l.922
it cannot find them in the current directory.
@y
it cannot find them in the current directory.%
@@ -151,7 +160,7 @@ for it.
(This is true for any other input or change file lookup.)}
@z
-@x
+@x l.1029
except for error messages.
@y
except for error messages.%
@@ -159,7 +168,7 @@ except for error messages.%
options `\.{b}', `\.{h}', and `\.{p}' are `off' by default.}
@z
-@x
+@x l.1035
options are currently implemented:
\yskip
@@ -193,7 +202,7 @@ argument to switch between different user languages and macro packages.
\yskip
@z
-@x
+@x l.1071
\option x Include indexes and a table of contents in the \TEX/ file
output by \.{CWEAVE}. (On by default.) (Has no effect on \.{CTANGLE}.)
@y
@@ -201,14 +210,14 @@ output by \.{CWEAVE}. (On by default.) (Has no effect on \.{CTANGLE}.)
output by \.{CWEAVE}. (On by default.) (\.{CWEAVE} only.)
@z
-@x
+@x l.1127
Sometimes things don't work as smoothly, and you get a bunch of
@y
\pdffalse\acrohintfalse
Sometimes things don't work as smoothly, and you get a bunch of
@z
-@x
+@x l.1135
`$\\{main}(\\{argc},\39\\{argv}{}$)'.
@y
`$\\{main}(\\{argc},\39\\{argv}{}$)'.
@@ -217,7 +226,7 @@ Sometimes things don't work as smoothly, and you get a bunch of
\ifpdf\acrohinttrue\fi \ifhint\acrohinttrue\fi
@z
-@x
+@x l.1145
the `\.{@\#}' will put extra space after `$\langle\,$Other locals$\,\rangle$'.
@y
the `\.{@\#}' will put extra space after `$\langle\,$Other locals$\,\rangle$'.%
@@ -225,14 +234,14 @@ the `\.{@\#}' will put extra space after `$\langle\,$Other locals$\,\rangle$'.%
to suppress the extra space globally.}
@z
-@x
+@x l.1147
\section Hypertext and hyperdocumentation.
@y
\vfill\eject
\section Hypertext and hyperdocumentation.
@z
-@x
+@x l.1171
from \.{https://hint.userweb.mwn.de/hint/hintview.html}.
@y
from
@@ -240,7 +249,7 @@ from
{https://hint.userweb.mwn.de/hint/hintview.html}.%
@z
-@x
+@x l.1180
the program sources at \.{ftp://ftp.cs.stanford.edu/pub/ctwill}.
@y
the program sources at
@@ -250,13 +259,13 @@ the program sources at
\.{ctwill} executable -- and its associated helpers -- out of the box.}
@z
-@x
+@x l.1184
As an example of a real program written in \.{CWEB}, Appendix~A
@y
As an example of a real program written in \.{CWEB}, \Appendix A
@z
-@x
+@x l.1189
Appendix B displays the files that set \TEX/ up to accept
the output of \.{CWEAVE}, and Appendix~C discusses how to use some of those
@y
@@ -264,7 +273,7 @@ the output of \.{CWEAVE}, and Appendix~C discusses how to use some of those
the output of \.{CWEAVE}, and \Appendix C discusses how to use some of those
@z
-@x
+@x l.1195
appendices D, E, and~F, which exhibit the complete source code for
\.{CTANGLE} and \.{CWEAVE}.
@@ -280,7 +289,7 @@ exhibits the source code for \.{CTWILL}, which is based on \.{CWEAVE}.}
\eject\titletrue
@z
-@x
+@x l.1201
\section Appendix A: Excerpts from a \.{CWEB} Program.
@y
\def\subsections{4}
@@ -288,28 +297,28 @@ exhibits the source code for \.{CTWILL}, which is based on \.{CWEAVE}.}
\subsection CWEB file format.
@z
-@x
+@x l.1205
generated sections 27--31 of the file \.{common.w}, which contains
@y
generated sections 27--31 of the file
\pdfURL{\.{common.w}}{common.pdf}, which contains
@z
-@x
+@x l.1276
\def\runninghead{APPENDIX A --- TRANSLATION BY {\tentt CTANGLE}}
@y
\def\runninghead{APPENDIX A --- TRANSLATION BY {\tentt CTANGLE}}
\subsection Translation by CTANGLE.
@z
-@x
+@x l.1344
\def\runninghead{APPENDIX A --- TRANSLATION BY {\tentt CWEAVE}}
@y
\def\runninghead{APPENDIX A --- TRANSLATION BY {\tentt CWEAVE}}
\subsection Translation by CWEAVE.
@z
-@x
+@x l.1433
\def\runninghead{APPENDIX A --- FINAL DOCUMENT}
And here's what the same excerpt looks like when typeset.
@@ -326,7 +335,7 @@ And here's what the same excerpt looks like when typeset.
\def\C#1{\5\5\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$}
@z
-@x
+@x l.1515
\vfil\eject\titletrue
@y
\vfil\eject\titletrue
@@ -335,13 +344,13 @@ And here's what the same excerpt looks like when typeset.
\ifacro\acrohinttrue\fi \ifhint\acrohinttrue\fi
@z
-@x
+@x l.1617
\.{ { }\\vskip 15pt \\centerline\{(Version 4.11)\}{ }\\vfill\}}\cr}$$
@y
\.{ { }\\vskip 15pt \\centerline\{(Version 4.11)\}{ }\\vfill\}}\cr}$$
@z
-@x
+@x l.1732
if you have a duplex printer. Appendices D, E, and F of the complete
version of this manual are printed using a commented-out option that
substitutes `$\gets$' for `$=$' in the program listings. Looking at those
@@ -355,14 +364,14 @@ also make use of the alternative format for \CEE/ comments.}
Looking at those
@z
-@x
+@x l.1784
\point 20. Furthermore, group titles can be converted to an arbitrary
@y
\vfill\eject
\point 20. Furthermore, group titles can be converted to an arbitrary
@z
-@x
+@x l.1796
\vfill\end
@y
\point 21. With modern \TeX\ engines like `\.{luatex}', `\.{pdftex}', and
diff --git a/Build/source/texk/web2c/dvicopy.ch b/Build/source/texk/web2c/dvicopy.ch
index 6e3a35fe694..5b4ebbc5438 100644
--- a/Build/source/texk/web2c/dvicopy.ch
+++ b/Build/source/texk/web2c/dvicopy.ch
@@ -8,40 +8,40 @@
% Mar 20 91 THD Updated to dvicopy 1.2
% (more recent changes in the ChangeLog)
-@x [0] WEAVE: print changes only
+@x [0] l.59 WEAVE: print changes only
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
@z
-@x [1] Define my_name
+@x [1] l.97 Define my_name
@d banner=='This is DVIcopy, Version 1.6' {printed when the program starts}
@y
@d my_name=='dvicopy'
@d banner=='This is DVIcopy, Version 1.6' {printed when the program starts}
@z
-@x [2] No random reading on stdin, may be not seekable.
+@x [2] l.123 No random reading on stdin, may be not seekable.
@d random_reading==true {should we skip around in the file?}
@y
@<Globals in the outer block@>=
@!random_reading:boolean; {should we skip around in the file?}
@z
-@x [3] Purge non-local 'goto'.
+@x [3] l.134 Purge non-local 'goto'.
calls the `|jump_out|' procedure, which goes to the label |final_end|.
@d final_end = 9999 {go here to wrap it up}
@y
calls the `|jump_out|' procedure.
@z
-@x [3]
+@x [3] l.140
label final_end;
@y
@z
-@x [3] Set up kpathsea.
+@x [3] l.145 Set up kpathsea.
procedure initialize; {this procedure gets things started properly}
var @<Local variables for initialization@>@/
begin print_ln(banner);@/
@@ -55,7 +55,7 @@ procedure initialize; {this procedure gets things started properly}
print (banner); print_ln (version_string);
@z
-@x [5] Big enough arrays to convert the dvilj sample font document.
+@x [5] l.177 Big enough arrays to convert the dvilj sample font document.
@<Constants...@>=
@!max_fonts=100; {maximum number of distinct fonts}
@!max_chars=10000; {maximum number of different characters among all fonts}
@@ -85,7 +85,7 @@ procedure initialize; {this procedure gets things started properly}
% [7] Rename the integer types, as they collide with names used by C99.
% Rather than change the code all over the place, we use macros to do
% the renaming. This could also be done at C preprocessor level.
-@x [7]
+@x l.244
@d int_32 == integer {signed 32~bit integers}
@y
@d int_32 == integer {signed 32~bit integers}
@@ -103,7 +103,7 @@ procedure initialize; {this procedure gets things started properly}
% [11] Redirect output, so it can go to either stdout or stderr,
% depending on where the output dvi file is going.
-@x [11]
+@x l.310
@d print(#)==write(output,#)
@d print_ln(#)==write_ln(output,#)
@d new_line==write_ln(output) {start new line}
@@ -113,7 +113,7 @@ procedure initialize; {this procedure gets things started properly}
@d new_line==write_ln(term_out) {start new line}
@z
-@x [14] Permissive input.
+@x [14] l.379 Permissive input.
@!ASCII_code=" ".."~"; {a subrange of the integers}
@y
@!ASCII_code=0..255; {a subrange of the integers}
@@ -122,7 +122,7 @@ procedure initialize; {this procedure gets things started properly}
% [15] The text_char type is used as an array index into xord. The
% default type `char' produces signed integers, which are bad array
% indices in C.
-@x [15]
+@x l.399
@d text_char == char {the data type of characters in text files}
@d first_text_char=0 {ordinal number of the smallest element of |text_char|}
@d last_text_char=127 {ordinal number of the largest element of |text_char|}
@@ -132,7 +132,7 @@ procedure initialize; {this procedure gets things started properly}
@d last_text_char=255 {ordinal number of the largest element of |text_char|}
@z
-@x [23] Remove non-local goto, declare jump_out as noreturn
+@x [23] l.572 Remove non-local goto, declare jump_out as noreturn
so a procedure called |jump_out| has been introduced. This procedure, which
transfers control to the label |final_end| at the end of the program,
contains the only non-local |@!goto| statement in \.{\title}.
@@ -143,7 +143,7 @@ by a call on some system procedure that quietly terminates the program.
@y
so a procedure called |jump_out| has been introduced.
@z
-@x [23]
+@x [23] l.581
@d abort(#)==begin print_ln(' ',#,'.'); jump_out;
end
@@ -170,31 +170,31 @@ uexit(1);
end;
@z
-@x [24] Declare confusion as noreturn
+@x [24] l.596 Declare confusion as noreturn
says |confusion(|indication of where we are|)|.
@y
says |confusion|(indication of where we are).
@z
-@x [24]
+@x [24] l.599
procedure confusion(@!p:pckt_pointer);
@y
noreturn procedure confusion(@!p:pckt_pointer);
@z
-@x [25] Declare overflow as noreturn
+@x [25] l.608 Declare overflow as noreturn
procedure overflow(@!p:pckt_pointer;@!n:int_16u);
@y
noreturn procedure overflow(@!p:pckt_pointer;@!n:int_16u);
@z
-@x [62] cur_name is no longer a fixed-size array.
+@x [62] l.1235 cur_name is no longer a fixed-size array.
@!cur_name:packed array[1..name_length] of char; {external name,
with no lower case letters}
@y
@!cur_name:^char;
@z
-@x [63] Ignore arguments to make_font_name.
+@x [63] l.1240 Ignore arguments to make_font_name.
@ For \.{TFM} and \.{VF} files we just append the appropriate extension
to the file name packet; in addition a system dependent area part
(usually different for \.{TFM} and \.{VF} files) is prepended if
@@ -229,24 +229,24 @@ to |make_font_name|.
% [67] No conversion of filenames in lower case, and initialize and
% terminate for C strings. Eliminate now unused variable.
-@x [67]
+@x l.1310
@!c:char; {a character to be appended to |cur_name|}
@y
@z
-@x [67]
+@x [67] l.1312
cur_loc:=pckt_start[n]; cur_limit:=pckt_start[n+1];
@y
cur_name := xmalloc_array (char, pckt_length (n) + pckt_length (e));
cur_loc:=pckt_start[n]; cur_limit:=pckt_start[n+1];
@z
-@x [67]
+@x [67] l.1317
if (b>="a")and(b<="z") then Decr(b)(("a"-"A")); {convert to upper case}
@y
@z
-@x [67]
+@x [67] l.1320
cur_loc:=pckt_start[e]; cur_limit:=pckt_start[e+1];
while cur_loc<cur_limit do
begin pckt_extract(b); append_res_to_name(xchr[b]);
@@ -258,13 +258,13 @@ while l_cur_name<name_length do
cur_name[l_cur_name] := 0;
@z
-@x [91] Lower case file name extensions.
+@x [91] l.1716 Lower case file name extensions.
id4(".")("T")("F")("M")(tfm_ext); {file name extension for \.{TFM} files}
@y
id4(".")("t")("f")("m")(tfm_ext); {file name extension for \.{TFM} files}
@z
-@x [92] Set default directory name
+@x [92] l.1718 Set default directory name
@ If no font directory has been specified, \.{\title} is supposed to use
the default \.{TFM} directory, which is a system-dependent place where
the \.{TFM} files for standard fonts are kept.
@@ -280,26 +280,26 @@ The string variable |TFM_default_area| contains the name of this area.
@ If no font directory has been specified, we search paths.
@z
-@x [93] Remove initialization of now-defunct array
+@x [93] l.1730 Remove initialization of now-defunct array
@ @<Set init...@>=
TFM_default_area:=TFM_default_area_name;
@y
@ (No initialization to be done. Keep this module to preserve numbering.)
@z
-@x [94] Declare bad_tfm as noreturn
+@x [94] l.1738 Declare bad_tfm as noreturn
procedure bad_tfm;
@y
noreturn procedure bad_tfm;
@z
-@x [94] Declare bad_font as noreturn
+@x [94] l.1745 Declare bad_font as noreturn
procedure bad_font;
@y
noreturn procedure bad_font;
@z
-@x [95] Open TFM file
+@x [95] l.1757 Open TFM file
@<TFM: Open |tfm_file|@>=
make_font_name(TFM_default_area_name_length)(TFM_default_area)(tfm_ext);
reset(tfm_file,cur_name);
@@ -318,7 +318,7 @@ if full_name then begin
end else
@z
-@x [104] Compute alpha and beta.
+@x [104] l.1990 Compute alpha and beta.
alpha:=16;
while z>=@'40000000 do
@y
@@ -327,20 +327,20 @@ if z>=@'1000000000 then abort('Character size is too large!');
while z>=@'40000000 do
@z
-@x [108] Declare full_name.
+@x [108] l.2060 Declare full_name.
@!dvi_loc:int_32; {where we are about to look, in |dvi_file|}
@y
@!dvi_loc:int_32; {where we are about to look, in |dvi_file|}
@!full_name: ^char;
@z
-@x [109] Declare bad_dvi as noreturn
+@x [109] l.2067 Declare bad_dvi as noreturn
procedure bad_dvi;
@y
noreturn procedure bad_dvi;
@z
-@x [110] Fix up opening the binary files
+@x [110] l.2076 Fix up opening the binary files
@ To prepare |dvi_file| for input, we |reset| it.
@<Open input file(s)@>=
@@ -353,7 +353,7 @@ dvi_loc:=0;
dvi_loc:=0;
@z
-@x [112] Make dvi_length() and dvi_move() work.
+@x [112] l.2114 Make dvi_length() and dvi_move() work.
@p function dvi_length:int_32;
begin set_pos(dvi_file,-1); dvi_length:=cur_pos(dvi_file);
end;
@@ -374,13 +374,13 @@ dvi_loc:=n;
end;
@z
-@x [135] Lower case file name extensions.
+@x [135] l.2467 Lower case file name extensions.
id3(".")("V")("F")(vf_ext); {file name extension for \.{VF} files}
@y
id3(".")("v")("f")(vf_ext); {file name extension for \.{VF} files}
@z
-@x [137] Set default directory name
+@x [137] l.2481 Set default directory name
@ If no font directory has been specified, \.{\title} is supposed to use
the default \.{VF} directory, which is a system-dependent place where
the \.{VF} files for standard fonts are kept.
@@ -407,7 +407,7 @@ by setting the \.{VFFONTS} environment variable.
@ (No initialization to be done. Keep this module to preserve numbering.)
@z
-@x [139] Open VF file
+@x [139] l.2498 Open VF file
@<VF: Open |vf_file| or |goto not_found|@>=
make_font_name(VF_default_area_name_length)(VF_default_area)(vf_ext);
reset(vf_file,cur_name);
@@ -426,7 +426,7 @@ if full_name then begin
end else
@z
-@x [163] copy elements of array piece by piece
+@x [163] l.2937 copy elements of array piece by piece
@ @<VF: Start a new level@>=
append_one(push);
vf_move[vf_ptr]:=vf_move[vf_ptr-1];
@@ -444,19 +444,19 @@ append_one(push);
vf_move_assign;
@z
-@x [170] and again...
+@x [170] l.3033 and again...
vf_move[vf_ptr]:=vf_move[vf_ptr-1];
@y
vf_move_assign;
@z
-@x [176] break is fflush.
+@x [176] l.3138 break is fflush.
@d update_terminal == break(output) {empty the terminal output buffer}
@y
@d update_terminal == fflush(stdout) {empty the terminal output buffer}
@z
-@x [176]
+@x [176] l.3148
procedure input_ln; {inputs a line from the terminal}
var k:0..terminal_line_length;
begin if n_opt=0 then
@@ -484,42 +484,42 @@ while (k<terminal_line_length)and not eoln(input) do
end;
@z
-@x [241] No dialog, remove unused final label.
+@x [241] l.4070 No dialog, remove unused final label.
dialog; {get options}
@y
@z
-@x [241]
+@x [241] l.4075
final_end:end.
@y
end.
@z
-@x [246] Do this later, to avoid creating empty files.
+@x [246] l.4124 Do this later, to avoid creating empty files.
@<Open output file(s)@>=
rewrite(out_file); {prepares to write packed bytes to |out_file|}
@y
@<Open output file(s)@>=
@z
-@x [248] Use external routine to output bytes.
+@x [248] l.4141 Use external routine to output bytes.
@d out_byte(#) == write(out_file,#) {write next \.{DVI} byte}
@y
@d out_byte(#) == put_byte(#,out_file) {write next \.{DVI} byte}
@z
-@x [260] String declaration.
+@x [260] l.4259 String declaration.
@!comment:packed array[1..comm_length] of char; {preamble comment prefix}
@y
@!comment:const_c_string; {preamble comment prefix}
@z
-@x [261] Output the string from 0 to len-1, not 1 to len.
+@x [261] l.4270 Output the string from 0 to len-1, not 1 to len.
for k:=1 to comm_length do append_byte(xord[comment[k]]);
@y
for k:=0 to comm_length - 1 do append_byte(xord[ucharcast(comment[k])]);
@z
-@x [293] System-dependent changes.
+@x [293] l.4480 System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \.{DVIcopy} work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/dvitype.ch b/Build/source/texk/web2c/dvitype.ch
index 3c750d92a67..c22c080a6de 100644
--- a/Build/source/texk/web2c/dvitype.ch
+++ b/Build/source/texk/web2c/dvitype.ch
@@ -20,12 +20,17 @@
% 01/16/90 (SR) To version 3.2.
% (more recent changes in the ChangeLog)
+@x [0] l.32
+\def\title{DVI$\,$\lowercase{type}}
+@y
+\def\title{DVI$\,$\lowercase{type} changes for C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{DVI$\,$\lowercase{type} changes for C}
@z
@x [1] Define my_name
diff --git a/Build/source/texk/web2c/gftodvi.ch b/Build/source/texk/web2c/gftodvi.ch
index 41f793ad124..90ecd85da2a 100644
--- a/Build/source/texk/web2c/gftodvi.ch
+++ b/Build/source/texk/web2c/gftodvi.ch
@@ -35,12 +35,17 @@
% Revision 0.3 84/11/17 23:51:56 richards
% Base version for GFtoDVI Version 0.3
+@x [0] l.32
+\def\title{GF$\,$\lowercase{to}$\,$DVI}
+@y
+\def\title{GF$\,$\lowercase{to}$\,$DVI changes for C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{GF$\,$\lowercase{to}$\,$DVI changes for C}
@z
@x [1] Define my_name
diff --git a/Build/source/texk/web2c/gftopk.ch b/Build/source/texk/web2c/gftopk.ch
index e4ddf19c8b6..1afa9119ef7 100644
--- a/Build/source/texk/web2c/gftopk.ch
+++ b/Build/source/texk/web2c/gftopk.ch
@@ -11,12 +11,17 @@
% on the origin of fonts in both gf and pk formats. The program runs
% silently unless it is given the -v switch in the command line.
+@x [0] l.44
+\def\title{GFtoPK}
+@y
+\def\title{GF$\,$\lowercase{to}$\,$PK changes C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{GF$\,$\lowercase{to}$\,$PK changes C}
@z
@x [1] Define my_name
diff --git a/Build/source/texk/web2c/gftype.ch b/Build/source/texk/web2c/gftype.ch
index 83834e76c26..49d7bf6b3e0 100644
--- a/Build/source/texk/web2c/gftype.ch
+++ b/Build/source/texk/web2c/gftype.ch
@@ -15,12 +15,17 @@
% turns on images. There is no terminal input to this program.
% Output is to stdout, and may, of course, be redirected.
+@x [0] l.30
+\def\title{GFtype}
+@y
+\def\title{GF$\,$\lowercase{type} changes for C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{GF$\,$\lowercase{type} changes for C}
@z
@x [1] Define my_name
@@ -166,7 +171,7 @@ end;
@d text_char == char {the data type of characters in text files}
@z
-@x [21] Redo open_gf_file to do path searching.
+@x [22] Redo open_gf_file to do path searching.
@ To prepare this file for input, we |reset| it.
@p procedure open_gf_file; {prepares to read packed bytes in |gf_file|}
diff --git a/Build/source/texk/web2c/hitexdir/hitex.w b/Build/source/texk/web2c/hitexdir/hitex.w
index 2ddc5703f71..7351c672e2d 100644
--- a/Build/source/texk/web2c/hitexdir/hitex.w
+++ b/Build/source/texk/web2c/hitexdir/hitex.w
@@ -2010,7 +2010,6 @@ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9': if (deletions_allowed)
@<Delete \(c)|c-"0"| tokens and |goto resume|@>@;@+break;
-@t\4\4@>@;
#ifdef @!DEBUG
case 'D': {@+debug_help();goto resume;@+}
#endif
@@ -3883,7 +3882,7 @@ else switch (type(p)) {
case disc_node: @<Display discretionary |p|@>@;@+break;
case mark_node: @<Display mark |p|@>@;@+break;
case adjust_node: @<Display adjustment |p|@>@;@+break;
- @t\4@>@<Cases of |show_node_list| that arise in mlists only@>@;
+ @/@t\4@>@<Cases of |show_node_list| that arise in mlists only@>@;
default:print("Unknown node type!");
}
@@ -4123,7 +4122,7 @@ while (p!=null)
flush_node_list(post_break(p));
} @+break;
case adjust_node: flush_node_list(adjust_ptr(p));@+break;
- @t\4@>@<Cases of |flush_node_list| that arise in mlists only@>@;
+ @/@t\4@>@<Cases of |flush_node_list| that arise in mlists only@>@;
default:confusion("flushing");
@:this can't happen flushing}{\quad flushing@>
} @/
@@ -5708,8 +5707,9 @@ print_char('=');print_scaled(eqtb[n].sc);print("pt");
@ Here is a procedure that displays the contents of |eqtb[n]|
symbolically.
-@p @t\4@>@<Declare the procedure called |print_cmd_chr|@>@;@/
+@p @<Declare the procedure called |print_cmd_chr|@>@;
#ifdef @!STAT
+@+@t}\6\4\4{@>
static void show_eqtb(pointer @!n)
{@+if (n < active_base) print_char('?'); /*this can't happen*/
else if (n < glue_base) @<Show equivalent |n|, in region 1 or 2@>@;
@@ -7783,7 +7783,7 @@ and set |state:=mid_line|@>@;@+break;
any_state_plus(sup_mark): @<If this |sup_mark| starts an expanded character
like~\.{\^\^A} or~\.{\^\^df}, then |goto reswitch|, otherwise set |state:=mid_line|@>@;@+break;
any_state_plus(invalid_char): @<Decry the invalid character and |goto restart|@>@;
-@t\4@>@<Handle situations involving spaces, braces, changes of state@>@;
+@/@t\4@>@<Handle situations involving spaces, braces, changes of state@>@;
default:do_nothing;
}
@@ -10795,6 +10795,7 @@ static str_number b_make_name_string(byte_file *f)
{@+return make_name_string();
}
#ifdef @!INIT
+@+@t}\6\4\4{@>
static str_number w_make_name_string(word_file *f)
{@+return make_name_string();
}
@@ -14971,7 +14972,7 @@ case rel_noad: case close_noad: case punct_noad:
if (type(q)==right_noad) goto done_with_noad;
} @+break;
@/@t\4@>@<Cases for noads that can follow a |bin_noad|@>@;
-@t\4@>@<Cases for nodes that can appear in an mlist, after which we |goto
+@/@t\4@>@<Cases for nodes that can appear in an mlist, after which we |goto
done_with_node|@>@;
default:confusion("mlist1");
@:this can't happen mlist1}{\quad mlist1@>
@@ -16431,7 +16432,8 @@ else
flush_node_list(p);pop_alignment();
}
@<Insert the \(c)current list into its environment@>;
-} @/
+}
+@#
@t\4@>@<Declare the procedure called |align_peek|@>@;
@ It's time now to dismantle the preamble list and to compute the column
@@ -20805,7 +20807,7 @@ case hmode+no_boundary: {@+get_x_token();
case hmode+spacer: if (space_factor==1000) goto append_normal_space;
else app_space();@+break;
case hmode+ex_space: case mmode+ex_space: goto append_normal_space;
-@t\4@>@<Cases of |main_control| that are not part of the inner loop@>@;
+@/@t\4@>@<Cases of |main_control| that are not part of the inner loop@>@;
} /*of the big |case| statement*/
goto big_switch;
main_loop: @<Append character |cur_chr| and the following characters (if~any)
@@ -21495,7 +21497,7 @@ case bottom_level: {@+print_err("Too many }'s");
} @+break;
case semi_simple_group: case math_shift_group:
case math_left_group: extra_right_brace();@+break;
-@t\4@>@<Cases of |handle_right_brace| where a |right_brace| triggers a delayed
+@/@t\4@>@<Cases of |handle_right_brace| where a |right_brace| triggers a delayed
action@>@;
default:confusion("rightbrace");
@:this can't happen rightbrace}{\quad rightbrace@>
@@ -32109,7 +32111,7 @@ static void hint_open(void)
output_file_name=make_name_string();
DBG(DBGBASIC,"Output file %s opened\n",(char *)name_of_file+1);
}
-
+@#
#define HITEX_VERSION "1.1"
static void hput_definitions();
extern int option_global;
@@ -35167,8 +35169,9 @@ static bool b_open_out(byte_file *f) /*open a binary file for output*/
{@+f->f=open_out((char *)name_of_file+1,"wb");
return f->f!=NULL && ferror(f->f)==0;@+
}
-
+@#
#ifdef @!INIT
+@+@t}\6\4\4{@>
static bool w_open_out(word_file *f) /*open a word file for output*/
{@+f->f=open_out((char *)name_of_file+1,"wb");
return f->f!=NULL && ferror(f->f)==0;@+
diff --git a/Build/source/texk/web2c/mf.ch b/Build/source/texk/web2c/mf.ch
index 716241024d2..a4910a3d948 100644
--- a/Build/source/texk/web2c/mf.ch
+++ b/Build/source/texk/web2c/mf.ch
@@ -25,12 +25,17 @@
% MF.WEB 2.71828182 as of January, 2021 (published as Donald E. Knuth,
% Metafont: The Program, Volume D of Computers & Typesetting Jubilee Editions).
+@x [0.0] l.70
+\def\title{{\eightlogo METAFONT}}
+@y
+\def\title{{\eightlogo METAFONT} changes for C}
+@z
+
@x [0.0] l.75 - WEAVE: print changes only.
\def\botofcontents{\vskip 0pt plus 1fil minus 1.5in}
@y
\def\botofcontents{\vskip 0pt plus 1fil minus 1.5in}
\let\maybe=\iffalse
-\def\title{\MF\ changes for C}
\def\glob{13}\def\gglob{20, 25} % these are defined in module 1
@z
diff --git a/Build/source/texk/web2c/mft.ch b/Build/source/texk/web2c/mft.ch
index 1ad6c621d41..e1c0ef09de2 100644
--- a/Build/source/texk/web2c/mft.ch
+++ b/Build/source/texk/web2c/mft.ch
@@ -12,12 +12,17 @@
\def\MP{{\logo META}\-{\logo POST}}
@z
+@x [0] l.26
+\def\title{MFT}
+@y
+\def\title{MFT changes for C and METAPOST}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{MFT changes for C and METAPOST}
@z
@x [1]
diff --git a/Build/source/texk/web2c/patgen.ch b/Build/source/texk/web2c/patgen.ch
index 13775991b18..e6accc88d89 100644
--- a/Build/source/texk/web2c/patgen.ch
+++ b/Build/source/texk/web2c/patgen.ch
@@ -5,12 +5,17 @@
% properly---it is hard to test without more information.
% 03/23/88 (ETM) Brought up to date, converted for use with WEB to C.
+@x [0] Extend program title.
+\def\title{PATGEN}
+@y
+\def\title{PATGEN changes for C}
+@z
+
@x WEAVE: print changes only
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{PATGEN changes for C}
@z
@x [1] Define my_name
diff --git a/Build/source/texk/web2c/pktogf.ch b/Build/source/texk/web2c/pktogf.ch
index 9bbeb8e1481..bd468f2a9de 100644
--- a/Build/source/texk/web2c/pktogf.ch
+++ b/Build/source/texk/web2c/pktogf.ch
@@ -12,12 +12,17 @@
% gf and pk formats. PKtoGF runs silently unless it is given the
% -v switch in the command line.
+@x [0] l.21
+\def\title{PKtoGF}
+@y
+\def\title{PK$\,$\lowercase{to}$\,$GF changes for C}
+@z
+
@x [0] WEAVE: print changes only
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{PK$\,$\lowercase{to}$\,$GF changes for C}
@z
@x [2] Define my_name
diff --git a/Build/source/texk/web2c/pktype.ch b/Build/source/texk/web2c/pktype.ch
index 54424d84bab..b5e64566529 100644
--- a/Build/source/texk/web2c/pktype.ch
+++ b/Build/source/texk/web2c/pktype.ch
@@ -8,12 +8,17 @@
% There is no terminal input to this program.
% Output is to stdout, and may, of course, be redirected.
+@x [0] l.27
+\def\title{PKtype}
+@y
+\def\title{PK$\,$\lowercase{type} changes for C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{PK$\,$\lowercase{type} changes for C}
@z
@x [2] Define my_name
diff --git a/Build/source/texk/web2c/pltotf.ch b/Build/source/texk/web2c/pltotf.ch
index 82e6c1d9a99..fcc08fbc5cb 100644
--- a/Build/source/texk/web2c/pltotf.ch
+++ b/Build/source/texk/web2c/pltotf.ch
@@ -11,12 +11,17 @@
% 01/16/90 (SR) Version 3.2.
% (more recent changes in the ChangeLog)
+@x [0] l.34
+\def\title{PL\lowercase{to}TF}
+@y
+\def\title{PL$\,$\lowercase{to}$\,$TF changes for C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{PL$\,$\lowercase{to}$\,$TF changes for C}
@z
@x [1] Define my_name
diff --git a/Build/source/texk/web2c/pooltype.ch b/Build/source/texk/web2c/pooltype.ch
index 4ef47ad0ce3..74b4d9a2354 100644
--- a/Build/source/texk/web2c/pooltype.ch
+++ b/Build/source/texk/web2c/pooltype.ch
@@ -4,12 +4,17 @@
% 11/29/89 (KB) Version released with 8-bit TeX.
% (more recent changes in the ChangeLog)
+@x [0] l.16
+\def\title{POOL\lowercase{type}}
+@y
+\def\title{POOL\lowercase{type} changes for C}
+@z
+
@x [0] WEAVE: print changes only
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{POOL\lowercase{type} changes for C}
@z
@x [1] Define my_name
diff --git a/Build/source/texk/web2c/tangle.ch b/Build/source/texk/web2c/tangle.ch
index 066a7476581..5bb61fe776e 100644
--- a/Build/source/texk/web2c/tangle.ch
+++ b/Build/source/texk/web2c/tangle.ch
@@ -36,12 +36,17 @@
% 11/30/89 (KB) Version 4.
% (more recent changes in the ChangeLog)
+@x [0.0] l.34 - Replace program title.
+\def\title{TANGLE}
+@y
+\def\title{TANGLE changes for C}
+@z
+
@x [0.0] l.43 - Print only changes.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{TANGLE changes for C}
@z
@x [1.1] l.70 - Define my_name
diff --git a/Build/source/texk/web2c/tests/fix-changefile-lines.py b/Build/source/texk/web2c/tests/fix-changefile-lines.py
index 7efcdf3146a..c98165f1a24 100755
--- a/Build/source/texk/web2c/tests/fix-changefile-lines.py
+++ b/Build/source/texk/web2c/tests/fix-changefile-lines.py
@@ -11,17 +11,13 @@ Written by Tyge Tiessen, 2024. Public domain.
import getopt, os, re, sys
USAGE = f"""
-Usage: {os.path.basename(sys.argv[0])} [options] <web file> <change file>
+Usage: {os.path.basename(sys.argv[0])} [-i|--init] <web file> <change file>
Reads a WEB file and a change file and writes a change file to stdout with
potentially corrected part, section and line numbers.
-Options influence the '@x [part.section] l.line - text' format:
- -p, --parts Suppress the 'part' (starred section) number
- -s, --sections Suppress the (unstarred) 'section' number
- -l, --lines Suppress the 'l.line' number
- -h, --hyphens Suppress the '-'
- -t, --texts Suppress the 'text'
+The option '-i' ('--init') forces a '[part.section] l.line' tag after each
+'@x'; this is useful for untagged change files.
Written by Tyge Tiessen, 2024. Public domain.
""".strip()
@@ -54,13 +50,12 @@ class WebReader:
self.part_cnt = 0
self.section_cnt = 0
try:
- self._web_file = open(web_file, "r")
+ with open(web_file, "r") as file:
+ self._web_lines = [line.rstrip() for line in file]
except OSError:
eprint(f"Could not open {web_file}")
print(USAGE)
sys.exit(1)
- with self._web_file:
- self._web_lines = [line.rstrip() for line in self._web_file]
def next_line(self):
"""Returns the triple of current part, section and line numbers, as
@@ -69,11 +64,6 @@ class WebReader:
if self._pos >= len(self._web_lines):
return None
line = self._web_lines[self._pos]
- self._pos += 1
-
- part = self.part_cnt
- section = self.section_cnt
- line_number = self._pos
# Look for starred section == part
if line.startswith("@*"):
@@ -84,6 +74,11 @@ class WebReader:
if line.startswith("@ ") or line == "@":
self.section_cnt += 1
+ # Prepare return values
+ part = self.part_cnt
+ section = self.section_cnt
+ line_number = self._pos = self._pos + 1
+
# Look for '@i'nclude line
result = re.match("^@i \"?(\\w+(\\.\\w+)?)\"?", line)
if result:
@@ -92,6 +87,7 @@ class WebReader:
pass
self.part_cnt += inc_reader.part_cnt
self.section_cnt += inc_reader.section_cnt
+ # Do not increase 'part' and 'section' just yet
# Ignore line count in include file; we're only one step beyond
return (part, section, line_number), line
@@ -107,13 +103,12 @@ class ChangeReader:
self._chunk_start = None
self._match_lines = None
try:
- self._change_file = open(change_file, "r")
+ with open(change_file, "r") as file:
+ self._lines = [line.rstrip() for line in file]
except OSError:
eprint(f"Could not open {change_file}")
print(USAGE)
sys.exit(1)
- with self._change_file:
- self._lines = [line.rstrip() for line in self._change_file]
def advance_to_next_chunk(self):
"""Find the next change chunk. Store where it starts and
@@ -127,9 +122,7 @@ class ChangeReader:
while True:
self._pos += 1
if self._pos >= len(self._lines):
- eprint(
- f"ERROR: Missing @y for @x on l.{self._chunk_start + 1} in change file"
- )
+ eprint(f"! Change file ended before @y. (l. {self._pos+1} of change file)")
sys.exit(1)
line = self._lines[self._pos]
if line.startswith("@y"):
@@ -137,26 +130,34 @@ class ChangeReader:
self._chunk_start + 1 : self._pos
]
return True
+ elif line.startswith("@x") or line.startswith("@z"):
+ eprint(f"! Where is the matching @y?. (l. {self._pos+1} of change file)")
+ eprint(line)
+ sys.exit(1)
self._pos += 1
return False
def find_match_in_web(self, web_reader):
"""Find the match for the current change chunk in the WEB file.
- Returns the part number and section number just before the first match line,
- as well as the line number of the first match line in the WEB file.
+ Returns the part, section, and line number of the first match line in
+ the WEB file.
"""
while True:
- (part, section, line_number), tex_line = web_reader.next_line()
- if tex_line is None:
- eprint("ERROR: Could not find match for line:")
- eprint(f" {self._match_lines[0]}")
+ try:
+ (part, section, line_number), tex_line = web_reader.next_line()
+ except:
+ eprint(f"! Change file entry did not match. (l. {self._chunk_start+2} of change file)")
+ eprint(self._match_lines[0])
sys.exit(1)
if tex_line == self._match_lines[0]:
for i in range(1, len(self._match_lines)):
- _, tex_line = web_reader.next_line()
+ try:
+ _, tex_line = web_reader.next_line()
+ except:
+ tex_line = None
if tex_line is None or tex_line != self._match_lines[i]:
- eprint("ERROR: Could not match all lines following match line:")
- eprint(f" {self._match_lines[0]}")
+ eprint(f"! Change file entry did not match. (l. {self._chunk_start+2+i} of change file)")
+ eprint(self._match_lines[i])
sys.exit(1)
return part, section, line_number
@@ -166,60 +167,22 @@ class ChangeReader:
while self.advance_to_next_chunk():
part, section, line_number = self.find_match_in_web(web_reader)
- # Attempt to catch the case where something is inserted just before
- # the start of a section.
- match_start = self._match_lines[0].strip()[:2]
- for repl_index in range(self._pos + 1, len(self._lines)):
- repl_start = self._lines[repl_index].strip()[:2]
- # CWEB @qcomments@> are ignored; see ctwill-w2c.ch
- if repl_start != "@q":
- break
- if match_start == "@ ":
- if repl_start in ["@ ", "@*"]:
- section += 1
- elif match_start == "@*":
- if repl_start == "@*":
- part += 1
- section += 1
- elif repl_start == "@ ":
- section += 1
-
- # Remove leading @x.
- text = self._lines[self._chunk_start][2:].strip()
-
- # Remove potentially leading [part.section] tag.
- pattern = "\\[\\d+(\\.\\d+)?\\]"
- if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1).strip()
-
- # Remove potentially line number information.
- pattern = "l\\.\\d+"
- if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1)
-
- # Remove potentially text comment separator.
- pattern = " -*"
- if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1).strip()
-
- # Create line with standard tag and optional information.
- new_line = "@x"
- if opt_handler.part_b or opt_handler.section_b:
- new_line += " ["
- if opt_handler.part_b:
- new_line += f"{part}"
- if opt_handler.part_b and opt_handler.section_b:
- new_line += "."
- if opt_handler.section_b:
- new_line += f"{section}"
- new_line += "]"
- if opt_handler.line_b:
- new_line += f" l.{line_number}"
-
- if opt_handler.text_b and text:
- if opt_handler.hyphen_b:
- new_line += " -"
- new_line += f" {text}"
+ # Replace '@x' line with updated information.
+ new_line = self._lines[self._chunk_start]
+
+ new_line = re.sub(
+ "\\[\\d+\\.\\d+\\]", f"[{part}.{section}]", new_line, 1)
+ new_line = re.sub(
+ "^@x \\[\\d+\\]", f"@x [{section}]", new_line, 1)
+ new_line = re.sub(
+ "l\\.\\d+", f"l.{line_number}", new_line, 1)
+
+ # Force '[part.section] l.line' tag after '@x'; useful for untagged
+ # change files, e.g., CWEB's '*-w2c.ch' monsters.
+ if opt_handler.init_b:
+ new_line = re.sub(
+ "^@x", f"@x [{part}.{section}] l.{line_number}",
+ new_line, 1)
ch_line = self._lines[self._chunk_start]
if new_line[:10] != ch_line[:10]:
@@ -241,33 +204,19 @@ class OptHandler:
"""
def __init__(self):
- # Optional elements of the output format
- # '@x [{part}.{section}] l.{line} {-(hyphen)} {text}'
- self.part_b = True
- self.section_b = True
- self.line_b = True
- self.hyphen_b = True
- self.text_b = True
+ # Should we insert tag '[{part}.{section}] l.{line}' after '@x'?
+ self.init_b = False
try:
- opts, self.args = getopt.getopt(sys.argv[1:], "pslht",
- ["parts", "sections", "lines", "hyphens", "texts"])
+ opts, self.args = getopt.getopt(sys.argv[1:], "i", ["init"])
except getopt.GetoptError as err:
eprint(f"\n{os.path.basename(sys.argv[0])}: {err}!\n")
print(USAGE)
sys.exit(1)
for opt, _ in opts:
- if opt in ("-p", "--parts"):
- self.part_b = False
- elif opt in ("-s", "--sections"):
- self.section_b = False
- elif opt in ("-l", "--lines"):
- self.line_b = False
- elif opt in ("-h", "--hyphens"):
- self.hyphen_b = False
- elif opt in ("-t", "--texts"):
- self.text_b = False
+ if opt in ("-i", "--init"):
+ self.init_b = True
else:
assert False, f"Unhandled option {opt}"
diff --git a/Build/source/texk/web2c/tex.ch b/Build/source/texk/web2c/tex.ch
index 1ecc140099f..869be96b54d 100644
--- a/Build/source/texk/web2c/tex.ch
+++ b/Build/source/texk/web2c/tex.ch
@@ -136,7 +136,7 @@ we still have to declare the symbolic names.
@d tats==endif('STAT')
@z
-@x [1.8] l.322 - Somewhat different for `init...tini'.. 310 m.8
+@x [1.8] l.322 - Somewhat different for `init...tini'.
the codewords `$|init|\ldots|tini|$'.
@d init== {change this to `$\\{init}\equiv\.{@@\{}$' in the production version}
@@ -1178,7 +1178,7 @@ end;
@!nest:^list_state_record;
@z
-@x [16.215] l.4365 - reference from initialize.
+@x [16.215] l.4365 - remove mem[] reference from initialize.
prev_graf:=0; shown_mode:=0;
@<Start a new current page@>;
@y
@@ -3238,7 +3238,7 @@ main_i:=char_info(main_f)(cur_l);
main_i:=effective_char_info(main_f,cur_l);
@z
-@x [46.1049] l.20440
+@x [46.1049] l.20440 - i18n fix, see change to [16.211]
print("' in "); print_mode(mode);
@y
print_in_mode(mode);
@@ -3699,7 +3699,7 @@ par_token:=cs_token_flag+par_loc;@/
undump(hash_base)(hash_top)(write_loc);@/
@z
-@x [50.1315] l.24005 - Make dumping/undumping more efficienteqtb
+@x [50.1315] l.24005 - Make dumping/undumping more efficient - eqtb
while k<l do
begin dump_wd(eqtb[k]); incr(k);
end;
@@ -3707,7 +3707,7 @@ while k<l do
dump_things(eqtb[k], l-k);
@z
-@x [50.1316] l.24024 - Make dumping/undumping more efficienteqtb
+@x [50.1316] l.24024 - Make dumping/undumping more efficient - eqtb
while k<l do
begin dump_wd(eqtb[k]); incr(k);
end;
@@ -3725,7 +3725,7 @@ if hash_high>0 then dump_things(eqtb[eqtb_size+1],hash_high);
{dump |hash_extra| part}
@z
-@x [50.1317] l.24034 - Make dumping/undumping more efficienteqtb
+@x [50.1317] l.24034 - Make dumping/undumping more efficient - eqtb
for j:=k to k+x-1 do undump_wd(eqtb[j]);
@y
undump_things(eqtb[k], x);
@@ -3767,7 +3767,7 @@ if hash_high > 0 then begin
end;
@z
-@x [50.1320] l.24065 - Make dumping/undumping more efficienttfm
+@x [50.1320] l.24065 - Make dumping/undumping more efficient - tfm
for k:=0 to fmem_ptr-1 do dump_wd(font_info[k]);
dump_int(font_ptr);
for k:=null_font to font_ptr do
@@ -3808,7 +3808,7 @@ undump_size(font_base)(font_base+max_font_max)('font max')(font_ptr);
% in the same section of the fmt file. But it's a lot faster to
% write the arrays of information out, one whole array at a time.
% So that's the way we handle dumping and undumping font info.
-@x [50.1322] l.24080 - Make dumping/undumping more efficienttfm
+@x [50.1322] l.24080 - Make dumping/undumping more efficient - tfm
@ @<Dump the array info for internal font number |k|@>=
begin dump_qqqq(font_check[k]);
dump_int(font_size[k]);
@@ -3875,7 +3875,7 @@ for k:=null_font to font_ptr do
end
@z
-@x [50.1323] l.24111 - Make dumping/undumping more efficienttfm
+@x [50.1323] l.24111 - Make dumping/undumping more efficient - tfm
@ @<Undump the array info for internal font number |k|@>=
begin undump_qqqq(font_check[k]);@/
undump_int(font_size[k]);
@@ -3990,7 +3990,7 @@ if hyph_count<>1 then print(" hyphenation exceptions")
else print(" hyphenation exception");
@z
-@x [50.1324] l.24146 - Make dumping/undumping more efficienttrie
+@x [50.1324] l.24146 - Make dumping/undumping more efficient - trie
for k:=0 to trie_max do dump_hh(trie[k]);
@y
dump_things(trie_trl[0], trie_max+1);
@@ -3998,7 +3998,7 @@ dump_things(trie_tro[0], trie_max+1);
dump_things(trie_trc[0], trie_max+1);
@z
-@x [50.1324] l.24148 - Make dumping/undumping more efficienttrie
+@x [50.1324] l.24148 - Make dumping/undumping more efficient - trie
for k:=1 to trie_op_ptr do
begin dump_int(hyf_distance[k]);
dump_int(hyf_num[k]);
@@ -4049,7 +4049,7 @@ for k:=1 to hyph_count do
if hyph_next >= hyph_prime then incr(hyph_next);
@z
-@x [50.1325] l.24174 - Make dumping/undumping more efficienttrie
+@x [50.1325] l.24174 - Make dumping/undumping more efficient - trie
for k:=0 to j do undump_hh(trie[k]);
@y
{These first three haven't been allocated yet unless we're \.{INITEX};
@@ -4062,7 +4062,7 @@ if not trie_trc then trie_trc:=xmalloc_array(quarterword, j+1);
undump_things(trie_trc[0], j+1);
@z
-@x [50.1325] l.24176 - Make dumping/undumping more efficienttrie
+@x [50.1325] l.24176 - Make dumping/undumping more efficient - trie
for k:=1 to j do
begin undump(0)(63)(hyf_distance[k]); {a |small_number|}
undump(0)(63)(hyf_num[k]);
@@ -4355,7 +4355,7 @@ if trie_not_ready then begin {initex without format loaded}
dump_core {do something to cause a core dump}
@z
-@x [52.1339] l.24511 - debugprint tfm info
+@x [52.1339] l.24511 - debug - print tfm info
5: print_word(font_info[n]);
@y
5: begin print_scaled(font_info[n].sc); print_char(" ");@/
@@ -5029,7 +5029,7 @@ if x=1 then mltex_enabled_p:=true
else if x<>0 then goto bad_fmt;
@z
-@x [54.1379] l.24996 - extra routines
+@x [55.1380] l.24996 - extra routines
@* \[55] Index.
@y
diff --git a/Build/source/texk/web2c/tftopl.ch b/Build/source/texk/web2c/tftopl.ch
index 973537d531f..445ba8e3ab1 100644
--- a/Build/source/texk/web2c/tftopl.ch
+++ b/Build/source/texk/web2c/tftopl.ch
@@ -15,12 +15,17 @@
% 01/16/90 (SR) Version 3.1.
% (more recent changes in the ChangeLog)
+@x [0] l.28
+\def\title{TF\lowercase{to}PL}
+@y
+\def\title{TF\lowercase{to}PL changes for C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{TF\lowercase{to}PL changes for C}
@z
@x [1] Define my_name
diff --git a/Build/source/texk/web2c/vftovp.ch b/Build/source/texk/web2c/vftovp.ch
index bcb0020e2fb..6b423e33408 100644
--- a/Build/source/texk/web2c/vftovp.ch
+++ b/Build/source/texk/web2c/vftovp.ch
@@ -2,12 +2,17 @@
% Written by kb@cs.umb.edu.
% This file is in the public domain.
+@x [0] l.18
+\def\title{VF\lowercase{to}VP}
+@y
+\def\title{VF$\,$\lowercase{to}$\,$VP changes for C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{VF$\,$\lowercase{to}$\,$VP changes for C}
@z
@x [1] Define my_name
diff --git a/Build/source/texk/web2c/vptovf.ch b/Build/source/texk/web2c/vptovf.ch
index 7a55c0642ca..d9ec8935155 100644
--- a/Build/source/texk/web2c/vptovf.ch
+++ b/Build/source/texk/web2c/vptovf.ch
@@ -1,11 +1,16 @@
% vptovf.ch for C compilation with web2c.
+@x [0] l.22
+\def\title{VP\lowercase{to}VF}
+@y
+\def\title{VP$\,$\lowercase{to}$\,$VF changes for C}
+@z
+
@x [0] WEAVE: print changes only.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
-\def\title{VP$\,$\lowercase{to}$\,$VF changes for C}
@z
@x [1] Define my_name