summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-11-20 23:01:11 +0000
committerKarl Berry <karl@freefriends.org>2021-11-20 23:01:11 +0000
commitcdb8cc3d9c6117cbec0b6935d177d829073b30fe (patch)
tree7f0400e0285e8e2cf66fe3d735a18ca872ba14e9
parente6136d0b484623d79a0c5dd8fe5ec1e20d970209 (diff)
scripts xetex-unsafe and xelatex-unsafe, for xetex+pstricks+transparency
git-svn-id: svn://tug.org/texlive/trunk@61101 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dvipdfm-x/data/dvipdfmx.cfg23
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.am2
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.in14
-rw-r--r--Build/source/texk/texlive/linked_scripts/README4
-rw-r--r--Build/source/texk/texlive/linked_scripts/scripts.lst8
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive-extra/xelatex-unsafe.sh24
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive-extra/xetex-unsafe.sh37
l---------Master/bin/aarch64-linux/xelatex-unsafe1
l---------Master/bin/aarch64-linux/xetex-unsafe1
l---------Master/bin/amd64-freebsd/xelatex-unsafe1
l---------Master/bin/amd64-freebsd/xetex-unsafe1
l---------Master/bin/amd64-netbsd/xelatex-unsafe1
l---------Master/bin/amd64-netbsd/xetex-unsafe1
l---------Master/bin/armhf-linux/xelatex-unsafe1
l---------Master/bin/armhf-linux/xetex-unsafe1
l---------Master/bin/i386-cygwin/xelatex-unsafe1
l---------Master/bin/i386-cygwin/xetex-unsafe1
l---------Master/bin/i386-freebsd/xelatex-unsafe1
l---------Master/bin/i386-freebsd/xetex-unsafe1
l---------Master/bin/i386-linux/xelatex-unsafe1
l---------Master/bin/i386-linux/xetex-unsafe1
l---------Master/bin/i386-netbsd/xelatex-unsafe1
l---------Master/bin/i386-netbsd/xetex-unsafe1
l---------Master/bin/i386-solaris/xelatex-unsafe1
l---------Master/bin/i386-solaris/xetex-unsafe1
l---------Master/bin/universal-darwin/xelatex-unsafe1
l---------Master/bin/universal-darwin/xetex-unsafe1
l---------Master/bin/x86_64-cygwin/xelatex-unsafe1
l---------Master/bin/x86_64-cygwin/xetex-unsafe1
l---------Master/bin/x86_64-darwinlegacy/xelatex-unsafe1
l---------Master/bin/x86_64-darwinlegacy/xetex-unsafe1
l---------Master/bin/x86_64-linux/xelatex-unsafe1
l---------Master/bin/x86_64-linux/xetex-unsafe1
l---------Master/bin/x86_64-linuxmusl/xelatex-unsafe1
l---------Master/bin/x86_64-linuxmusl/xetex-unsafe1
l---------Master/bin/x86_64-solaris/xelatex-unsafe1
l---------Master/bin/x86_64-solaris/xetex-unsafe1
-rw-r--r--Master/texmf-dist/doc/man/man1/Makefile3
-rw-r--r--Master/texmf-dist/doc/man/man1/xelatex-unsafe.11
-rw-r--r--Master/texmf-dist/doc/man/man1/xelatex-unsafe.man1.pdfbin0 -> 20375 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/xetex-unsafe.154
-rw-r--r--Master/texmf-dist/doc/man/man1/xetex-unsafe.man1.pdfbin0 -> 20375 bytes
-rw-r--r--Master/texmf-dist/dvipdfmx/dvipdfmx-unsafe.cfg10
-rw-r--r--Master/texmf-dist/dvipdfmx/dvipdfmx.cfg25
-rw-r--r--Master/texmf-dist/scripts/texlive-extra/README2
-rw-r--r--Master/texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh24
-rwxr-xr-xMaster/texmf-dist/scripts/texlive-extra/xetex-unsafe.sh37
-rw-r--r--Master/texmf-dist/scripts/texlive/README12
-rwxr-xr-xMaster/tlpkg/bin/tl-update-linked-scripts3
-rw-r--r--Master/tlpkg/tlpsrc/texlive-scripts-extra.tlpsrc2
-rw-r--r--Master/tlpkg/tlpsrc/xetex.tlpsrc13
51 files changed, 271 insertions, 57 deletions
diff --git a/Build/source/texk/dvipdfm-x/data/dvipdfmx.cfg b/Build/source/texk/dvipdfm-x/data/dvipdfmx.cfg
index 18edec9ebe2..2a0f4e50524 100644
--- a/Build/source/texk/dvipdfm-x/data/dvipdfmx.cfg
+++ b/Build/source/texk/dvipdfm-x/data/dvipdfmx.cfg
@@ -119,15 +119,8 @@ P 0x003C
%% Ghostscript (PS-to-PDF and PDF-to-PDF):
%%
-%% ps2pdf is a front-end to gs. For a complete list of options, see
-%% http://ghostscript.com/doc/current/Ps2pdf.htm#Options
-%%
-%% In TeX Live, we use the rungs wrapper instead of ps2pdf, becuse we
-%% must omit the -dSAFER which ps2pdf specifies: in order for pstricks
-%% to work with xetex,
-%% /usr/local/texlive/*/texmf-dist/dvips/pstricks/pstricks.pro (for
-%% example) needs to be accessed. Also, it is better to use our
-%% supplied gs on Windows.
+%% In TeX Live, we use the rungs wrapper instead of ps2pdf, in order to
+%% use our own supplied gs on Windows.
%%
%% Without the -dEPSCROP below, an eps file with negative llx/lly (as
%% created by MetaPost, for example) fails. In 2013, changes were made
@@ -137,27 +130,27 @@ P 0x003C
%%
%% In 2014, we discovered that -sPAPERSIZE=a0 was needed to support
%% pstricks under xetex; otherwise, images were cropped (see thread at
-%% http://tug.org/pipermail/xetex/2014-November/025664.html).
+%% https://tug.org/pipermail/xetex/2014-November/025664.html).
%% Happily, it seems that using both -dEPSCROP and -sPAPERSIZE=a0
%% simultaneously works ok. So that's we do below.
%%
%% By default, gs encodes all images contained in a PS file using
-%% the lossy DCT (i.e., JPEG) filter. This often leads to inferior
+%% the lossy DCT (i.e., JPEG) filter. This can lead to inferior
%% result (see the discussion at http://electron.mit.edu/~gsteele/pdf/).
%% The "-dAutoFilterXXXImages" and "-dXXXImageFilter" options used
%% below force all images to be encoded with the lossless Flate (zlib,
%% same as PNG) filter. Note that if the PS file already contains DCT
%% encoded images (which is possible in PS level 2), then these images
%% will also be re-encoded using Flate. To turn the conversion off,
-%% simply remove the options mentioned above.
+%% remove the options mentioned above.
%%
-%% Incidentally, especially in TL, more than one dvipdfmx.cfg may exist.
+%% Incidentally, more than one dvipdfmx.cfg may exist.
%% You can find the one that is active by running:
%% kpsewhich -progname=dvipdfmx -format=othertext dvipdfmx.cfg
%% and control which one is found by setting DVIPDFMXINPUTS.
%%
-D "rungs -q -dALLOWPSTRANSPARENCY -dSAFER -dNOPAUSE -dBATCH -dEPSCrop -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=%v -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dAutoRotatePages=/None -sOutputFile='%o' '%i' -c quit"
-%% If you change the above invocation, also change dvipdfmx-unsafe.cfg!
+D "rungs -q -dSAFER -dNOPAUSE -dBATCH -dEPSCrop -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=%v -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dAutoRotatePages=/None -sOutputFile='%o' '%i' -c quit"
+%% If you change the above rungs invocation, also change dvipdfmx-unsafe.cfg!
% other random ps converters people have experimented with.
%D "/usr/local/bin/ps2pdf -dEPSCrop '%i' '%o'"
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am
index 4c0486c54a2..7109f4ac07a 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.am
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.am
@@ -87,6 +87,8 @@ texmf_shell_scripts = \
texlive-extra/texconfig-sys.sh \
texlive-extra/texconfig.sh \
texlive-extra/texlinks.sh \
+ texlive-extra/xetex-unsafe.sh \
+ texlive-extra/xelatex-unsafe.sh
texosquery/texosquery.sh \
texosquery/texosquery-jre5.sh \
texosquery/texosquery-jre8.sh \
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in
index 7f3f6c4fb39..39660cb42ab 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.in
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.in
@@ -304,12 +304,8 @@ texmf_shell_scripts = \
texlive-extra/texconfig-sys.sh \
texlive-extra/texconfig.sh \
texlive-extra/texlinks.sh \
- texosquery/texosquery.sh \
- texosquery/texosquery-jre5.sh \
- texosquery/texosquery-jre8.sh \
- tikztosvg/tikztosvg \
- typeoutfileinfo/typeoutfileinfo.sh \
- wordcount/wordcount.sh
+ texlive-extra/xetex-unsafe.sh \
+ texlive-extra/xelatex-unsafe.sh
texmf_other_scripts = \
a2ping/a2ping.pl \
@@ -738,6 +734,12 @@ scripts-list: Makefile
installdirs-local:
$(MKDIR_P) $(DESTDIR)$(bindir)
+ texosquery/texosquery.sh \
+ texosquery/texosquery-jre5.sh \
+ texosquery/texosquery-jre8.sh \
+ tikztosvg/tikztosvg \
+ typeoutfileinfo/typeoutfileinfo.sh \
+ wordcount/wordcount.sh
install-data-hook: installdirs-local
@WIN32_TRUE@ @for s in $(texmf_other_scripts); do \
@WIN32_TRUE@ t=`basename $$s | sed 's,\.[^/]*$$,,' | tr '[A-Z]' '[a-z]'`; \
diff --git a/Build/source/texk/texlive/linked_scripts/README b/Build/source/texk/texlive/linked_scripts/README
index d512a83ddb5..0938fbd6b9d 100644
--- a/Build/source/texk/texlive/linked_scripts/README
+++ b/Build/source/texk/texlive/linked_scripts/README
@@ -1,5 +1,5 @@
$Id$
-Copyright (C) 2012 Norbert Preining <tex-live@tug.org>
+Copyright 2012-2021 Norbert Preining <tex-live@tug.org>
You may freely use, modify and/or distribute this file.
source/texk/texlive/linked_scripts
@@ -27,5 +27,5 @@ Steps to add a new script (take your time, do it right):
yourself -- don't use versions from distro packages.
* make -C BLD/texk/texlive/linked_scripts scripts-list
- where BLD is the build tree, to update the file scripts.lst in the
+ where BLD is the build tree, to update the file ./scripts.lst in the
source tree (or manually update that file).
diff --git a/Build/source/texk/texlive/linked_scripts/scripts.lst b/Build/source/texk/texlive/linked_scripts/scripts.lst
index 0c9aadd46ea..7de1c78fca3 100644
--- a/Build/source/texk/texlive/linked_scripts/scripts.lst
+++ b/Build/source/texk/texlive/linked_scripts/scripts.lst
@@ -31,12 +31,8 @@ texlive-extra/texconfig-dialog.sh
texlive-extra/texconfig-sys.sh
texlive-extra/texconfig.sh
texlive-extra/texlinks.sh
-texosquery/texosquery.sh
-texosquery/texosquery-jre5.sh
-texosquery/texosquery-jre8.sh
-tikztosvg/tikztosvg
-typeoutfileinfo/typeoutfileinfo.sh
-wordcount/wordcount.sh
+texlive-extra/xetex-unsafe.sh
+texlive-extra/xelatex-unsafe.sh
a2ping/a2ping.pl
accfonts/mkt1font
accfonts/vpl2ovp
diff --git a/Build/source/texk/texlive/linked_scripts/texlive-extra/xelatex-unsafe.sh b/Build/source/texk/texlive/linked_scripts/texlive-extra/xelatex-unsafe.sh
new file mode 100755
index 00000000000..de17ee3b7e4
--- /dev/null
+++ b/Build/source/texk/texlive/linked_scripts/texlive-extra/xelatex-unsafe.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# $Id$
+# Public domain. Originally written by Karl Berry, 2021.
+# Run Xe(La)TeX unsafely, for pstricks/transparency. See man page for more.
+
+if test "x$1" = x--help; then
+ mydir=`dirname $0`
+ if test -r "$mydir"/xetex-unsafe; then
+ xu="$mydir"/xetex-unsafe
+ elif test -r "$mydir"/xetex-unsafe.sh; then
+ xu="$mydir"/xetex-unsafe.sh
+ else
+ echo "$0: can't find companion xetex-unsafe[.sh] for help msg?" >&2
+ exit 1
+ fi
+ exec "$xu" --help # don't want to duplicate help message.
+
+elif test "x$1" = x--version; then
+ echo "$Id$"
+ exit 0
+fi
+
+cmd=`echo "$0" | sed s/-unsafe//`
+exec "$cmd" -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" "$@"
diff --git a/Build/source/texk/texlive/linked_scripts/texlive-extra/xetex-unsafe.sh b/Build/source/texk/texlive/linked_scripts/texlive-extra/xetex-unsafe.sh
new file mode 100755
index 00000000000..e07493cd6c3
--- /dev/null
+++ b/Build/source/texk/texlive/linked_scripts/texlive-extra/xetex-unsafe.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# $Id$
+# Public domain. Originally written by Karl Berry, 2021.
+# Run Xe(La)TeX unsafely, for pstricks/transparency. See man page for more.
+
+if test "x$1" = x--help; then
+ cat <<END_USAGE
+Usage: $0 [XETEX-ARGUMENT]...
+
+Run Xe(La)TeX unsafely, that is, using dvipdfmx-unsafe.cfg. All
+command-line arguments, except --help and --version, are passed as-is to
+Xe(La)TeX.
+
+As of TeX Live 2022, doing this is needed only when running XeTeX on
+documents using PSTricks features which require transparency. We
+recommend using Lua(La)TeX with PSTricks instead of XeTeX in this case.
+
+At all costs, avoid using this, or any, unsafe invocation with documents
+off the net or that are otherwise untrusted in any way.
+
+For more details on this, please see the xetex-unsafe(1) man page,
+or "texdoc xetex-unsafe".
+
+For more about XeTeX: https://tug.org/xetex
+For more about PSTricks: https://tug.org/PSTricks
+Email for xe(la)tex-unsafe specifically: https://lists.tug.org/dvipdfmx
+END_USAGE
+ echo '$Id$'
+ exit 0
+
+elif test "x$1" = x--version; then
+ echo '$Id$'
+ exit 0
+fi
+
+cmd=`echo "$0" | sed s/-unsafe//`
+exec "$cmd" -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" "$@"
diff --git a/Master/bin/aarch64-linux/xelatex-unsafe b/Master/bin/aarch64-linux/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/aarch64-linux/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/aarch64-linux/xetex-unsafe b/Master/bin/aarch64-linux/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/aarch64-linux/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/amd64-freebsd/xelatex-unsafe b/Master/bin/amd64-freebsd/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/amd64-freebsd/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/amd64-freebsd/xetex-unsafe b/Master/bin/amd64-freebsd/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/amd64-freebsd/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/amd64-netbsd/xelatex-unsafe b/Master/bin/amd64-netbsd/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/amd64-netbsd/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/amd64-netbsd/xetex-unsafe b/Master/bin/amd64-netbsd/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/amd64-netbsd/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/armhf-linux/xelatex-unsafe b/Master/bin/armhf-linux/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/armhf-linux/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/armhf-linux/xetex-unsafe b/Master/bin/armhf-linux/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/armhf-linux/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-cygwin/xelatex-unsafe b/Master/bin/i386-cygwin/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/i386-cygwin/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-cygwin/xetex-unsafe b/Master/bin/i386-cygwin/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/i386-cygwin/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-freebsd/xelatex-unsafe b/Master/bin/i386-freebsd/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/i386-freebsd/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-freebsd/xetex-unsafe b/Master/bin/i386-freebsd/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/i386-freebsd/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-linux/xelatex-unsafe b/Master/bin/i386-linux/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/i386-linux/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-linux/xetex-unsafe b/Master/bin/i386-linux/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/i386-linux/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-netbsd/xelatex-unsafe b/Master/bin/i386-netbsd/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/i386-netbsd/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-netbsd/xetex-unsafe b/Master/bin/i386-netbsd/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/i386-netbsd/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-solaris/xelatex-unsafe b/Master/bin/i386-solaris/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/i386-solaris/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/i386-solaris/xetex-unsafe b/Master/bin/i386-solaris/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/i386-solaris/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/universal-darwin/xelatex-unsafe b/Master/bin/universal-darwin/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/universal-darwin/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/universal-darwin/xetex-unsafe b/Master/bin/universal-darwin/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/universal-darwin/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-cygwin/xelatex-unsafe b/Master/bin/x86_64-cygwin/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/x86_64-cygwin/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-cygwin/xetex-unsafe b/Master/bin/x86_64-cygwin/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/x86_64-cygwin/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-darwinlegacy/xelatex-unsafe b/Master/bin/x86_64-darwinlegacy/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/x86_64-darwinlegacy/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-darwinlegacy/xetex-unsafe b/Master/bin/x86_64-darwinlegacy/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/x86_64-darwinlegacy/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-linux/xelatex-unsafe b/Master/bin/x86_64-linux/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/x86_64-linux/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-linux/xetex-unsafe b/Master/bin/x86_64-linux/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/x86_64-linux/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-linuxmusl/xelatex-unsafe b/Master/bin/x86_64-linuxmusl/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/x86_64-linuxmusl/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-linuxmusl/xetex-unsafe b/Master/bin/x86_64-linuxmusl/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/x86_64-linuxmusl/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-solaris/xelatex-unsafe b/Master/bin/x86_64-solaris/xelatex-unsafe
new file mode 120000
index 00000000000..89670186461
--- /dev/null
+++ b/Master/bin/x86_64-solaris/xelatex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh \ No newline at end of file
diff --git a/Master/bin/x86_64-solaris/xetex-unsafe b/Master/bin/x86_64-solaris/xetex-unsafe
new file mode 120000
index 00000000000..358d4dc4262
--- /dev/null
+++ b/Master/bin/x86_64-solaris/xetex-unsafe
@@ -0,0 +1 @@
+../../texmf-dist/scripts/texlive-extra/xetex-unsafe.sh \ No newline at end of file
diff --git a/Master/texmf-dist/doc/man/man1/Makefile b/Master/texmf-dist/doc/man/man1/Makefile
index e5691a16ed1..b5aa6c6ee11 100644
--- a/Master/texmf-dist/doc/man/man1/Makefile
+++ b/Master/texmf-dist/doc/man/man1/Makefile
@@ -200,5 +200,8 @@ man1/xdvipdfmx.man1.pdf: man1/xdvipdfmx.1 man1/dvipdfmx.1
man1/xelatex-dev.man1.pdf: man1/xelatex-dev.1 man1/latex-dev.1
$(MKPDF)
+man1/xelatex-unsafe.man1.pdf: man1/xelatex-unsafe.1 man1/xetex-unsafe.1
+ $(MKPDF)
+
man1/xelatex.man1.pdf: man1/xelatex.1 man1/latex.1
$(MKPDF)
diff --git a/Master/texmf-dist/doc/man/man1/xelatex-unsafe.1 b/Master/texmf-dist/doc/man/man1/xelatex-unsafe.1
new file mode 100644
index 00000000000..288cbb65307
--- /dev/null
+++ b/Master/texmf-dist/doc/man/man1/xelatex-unsafe.1
@@ -0,0 +1 @@
+.so man1/xetex-unsafe.1
diff --git a/Master/texmf-dist/doc/man/man1/xelatex-unsafe.man1.pdf b/Master/texmf-dist/doc/man/man1/xelatex-unsafe.man1.pdf
new file mode 100644
index 00000000000..b230aa43f14
--- /dev/null
+++ b/Master/texmf-dist/doc/man/man1/xelatex-unsafe.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/xetex-unsafe.1 b/Master/texmf-dist/doc/man/man1/xetex-unsafe.1
new file mode 100644
index 00000000000..0813c8a295a
--- /dev/null
+++ b/Master/texmf-dist/doc/man/man1/xetex-unsafe.1
@@ -0,0 +1,54 @@
+.TH XETEX-UNSAFE 1 "20 November 2021"
+.SH NAME
+xetex-unsafe, xelatex-unsafe \- run xe(la)latex unsafely
+.SH SYNOPSIS
+.B xetex-unsafe
+.RI [ xetex-options ]
+.B xelatex-unsafe
+.RI [ xetex-options ]
+.SH DESCRIPTION
+\fBxetex-unsafe\fP (\fBxelatex-unsafe\fP) runs XeTeX (XeLaTeX) unsafely;
+specifically, using the \fBdvipdfmx-unsafe.cfg\fP configuration file.
+.PP
+As of TeX Live 2022, doing this is necessary only when running XeTeX on
+documents using PSTricks features which require transparency. We strongly
+recommend using Lua(La)TeX with PSTricks instead of XeTeX in this case.
+.PP
+At all costs, avoid using this, or any, unsafe invocation with documents
+off the net or that are otherwise untrusted in any way.
+.SH WHY?
+You might well ask why using transparency features is unsafe in XeTeX.
+The answer lies in the implementation history of Ghostscript, starting
+as a PostScript interpreter before PDF was invented, when it was
+acceptable to abort on an error, whereas with PDF, it must keep going.
+The transparency operators, if abused in relation to this error
+recovery, can cause internal inconsistencies in Ghostscript's state.
+.PP
+Thus, to be safe, we must disallow transparency with Ghostscript by
+default. The \fBxdvipdfmx\fP backend for XeTeX calls Ghostscript under
+certain circumstances, notably when using PSTricks.
+\fB(x)dvipdfmx\fP itself is not a PostScript interpreter, which is
+exactly what PSTricks requires.
+.PP
+Thus, to enable transparency, \fBxe(la)tex-unsafe\fP run XeTeX with
+arguments to the \fBxdvipdfmx\fP backend (-output-driver="xdvipdfmx -i
+dvipdfmx-unsafe.cfg -q -E") to use \fBdvipdfmx-unsafe.cfg\fP, which in
+turn tells Ghostscript to enable the transparency operators
+(-dALLOWPSTRANSPARENCY). They're disabled by default.
+.PP
+There have been further complications related to reading from the
+filesystem, but as of TL22, these have been solved. The transparency
+issue cannot be solved without a different Ghostscript implementation,
+and the Ghostscript developers say they have no timeline for this.
+.PP
+To repeat the above: when using PSTricks and transparency, we strongly
+recommend playing it safe and using Lua(La)TeX instead of Xe(La)TeX.
+.SH OPTIONS
+All command-line arguments except \fB--help\fP and \fB--version\fP are
+passed to Xe(La)TeX.
+.SH BUGS
+For more about XeTeX: https://tug.org/xetex
+.PP
+For more about PSTricks: https://tug.org/PSTricks
+.PP
+Email for xe(la)tex-unsafe specifically: https://lists.tug.org/dvipdfmx
diff --git a/Master/texmf-dist/doc/man/man1/xetex-unsafe.man1.pdf b/Master/texmf-dist/doc/man/man1/xetex-unsafe.man1.pdf
new file mode 100644
index 00000000000..e2a09b95539
--- /dev/null
+++ b/Master/texmf-dist/doc/man/man1/xetex-unsafe.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/dvipdfmx/dvipdfmx-unsafe.cfg b/Master/texmf-dist/dvipdfmx/dvipdfmx-unsafe.cfg
index c37dd820122..e045df74ca9 100644
--- a/Master/texmf-dist/dvipdfmx/dvipdfmx-unsafe.cfg
+++ b/Master/texmf-dist/dvipdfmx/dvipdfmx-unsafe.cfg
@@ -4,7 +4,13 @@
%% This file is read after reading a default configuration file
%% dvipdfmx.cfg via an option -i dvipdfmx-unsafe.cfg. Or, from XeTeX:
%% -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E"
-%% (This is needed for PSTricks in XeTeX.)
+%% It is needed for PSTricks in XeTeX.
%%
+%% Wrapper scripts xetex-unsafe and xelatex-unsafe do the above;
+%% see their man page for more details.
+%%
+%% With the TL22 release and its dvipdfmx, we will remove -dNOSAFER here.
+%% https://tug.org/pipermail/tex-live-commits/2021-November/019700.html
+%%
D "rungs -q -dALLOWPSTRANSPARENCY -dNOSAFER -dNOPAUSE -dBATCH -dEPSCrop -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=%v -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dAutoRotatePages=/None -sOutputFile='%o' '%i' -c quit"
-%% If you change the above invocation, also change dvipdfmx.cfg!
+%% If you change the above rungs invocation, also change dvipdfmx.cfg!
diff --git a/Master/texmf-dist/dvipdfmx/dvipdfmx.cfg b/Master/texmf-dist/dvipdfmx/dvipdfmx.cfg
index dc154507acb..2a0f4e50524 100644
--- a/Master/texmf-dist/dvipdfmx/dvipdfmx.cfg
+++ b/Master/texmf-dist/dvipdfmx/dvipdfmx.cfg
@@ -1,4 +1,4 @@
-%% $Id: dvipdfmx.cfg 38778 2015-11-05 00:08:29Z karl $
+%% $Id$
%% dvipdfmx.cfg for dvipdfmx and xdvipdfmx. (Public domain.)
%% (maintained in TeX Live /source/ tree, copied to Master.)
%%
@@ -119,15 +119,8 @@ P 0x003C
%% Ghostscript (PS-to-PDF and PDF-to-PDF):
%%
-%% ps2pdf is a front-end to gs. For a complete list of options, see
-%% http://ghostscript.com/doc/current/Ps2pdf.htm#Options
-%%
-%% In TeX Live, we use the rungs wrapper instead of ps2pdf, becuse we
-%% must omit the -dSAFER which ps2pdf specifies: in order for pstricks
-%% to work with xetex,
-%% /usr/local/texlive/*/texmf-dist/dvips/pstricks/pstricks.pro (for
-%% example) needs to be accessed. Also, it is better to use our
-%% supplied gs on Windows.
+%% In TeX Live, we use the rungs wrapper instead of ps2pdf, in order to
+%% use our own supplied gs on Windows.
%%
%% Without the -dEPSCROP below, an eps file with negative llx/lly (as
%% created by MetaPost, for example) fails. In 2013, changes were made
@@ -137,27 +130,27 @@ P 0x003C
%%
%% In 2014, we discovered that -sPAPERSIZE=a0 was needed to support
%% pstricks under xetex; otherwise, images were cropped (see thread at
-%% http://tug.org/pipermail/xetex/2014-November/025664.html).
+%% https://tug.org/pipermail/xetex/2014-November/025664.html).
%% Happily, it seems that using both -dEPSCROP and -sPAPERSIZE=a0
%% simultaneously works ok. So that's we do below.
%%
%% By default, gs encodes all images contained in a PS file using
-%% the lossy DCT (i.e., JPEG) filter. This often leads to inferior
+%% the lossy DCT (i.e., JPEG) filter. This can lead to inferior
%% result (see the discussion at http://electron.mit.edu/~gsteele/pdf/).
%% The "-dAutoFilterXXXImages" and "-dXXXImageFilter" options used
%% below force all images to be encoded with the lossless Flate (zlib,
%% same as PNG) filter. Note that if the PS file already contains DCT
%% encoded images (which is possible in PS level 2), then these images
%% will also be re-encoded using Flate. To turn the conversion off,
-%% simply remove the options mentioned above.
+%% remove the options mentioned above.
%%
-%% Incidentally, especially in TL, more than one dvipdfmx.cfg may exist.
+%% Incidentally, more than one dvipdfmx.cfg may exist.
%% You can find the one that is active by running:
%% kpsewhich -progname=dvipdfmx -format=othertext dvipdfmx.cfg
%% and control which one is found by setting DVIPDFMXINPUTS.
%%
-D "rungs -q -dALLOWPSTRANSPARENCY -dSAFER -dNOPAUSE -dBATCH -dEPSCrop -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=%v -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dAutoRotatePages=/None -sOutputFile='%o' '%i' -c quit"
-%% If you change the above invocation, also change dvipdfmx-unsafe.cfg!
+D "rungs -q -dSAFER -dNOPAUSE -dBATCH -dEPSCrop -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=%v -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dAutoRotatePages=/None -sOutputFile='%o' '%i' -c quit"
+%% If you change the above rungs invocation, also change dvipdfmx-unsafe.cfg!
% other random ps converters people have experimented with.
%D "/usr/local/bin/ps2pdf -dEPSCrop '%i' '%o'"
diff --git a/Master/texmf-dist/scripts/texlive-extra/README b/Master/texmf-dist/scripts/texlive-extra/README
index 53854c6f407..55d0cebcecb 100644
--- a/Master/texmf-dist/scripts/texlive-extra/README
+++ b/Master/texmf-dist/scripts/texlive-extra/README
@@ -13,6 +13,6 @@ inherited from teTeX.
See texmf-dist/scripts/texlive/README (i.e., ../texlive/README) for more
info.
-The principal mailing list is http://lists.tug.org/tex-live.
+The principal mailing list is https://lists.tug.org/tex-live.
All of these scripts are free software, mostly public domain.
diff --git a/Master/texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh b/Master/texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh
new file mode 100644
index 00000000000..de17ee3b7e4
--- /dev/null
+++ b/Master/texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# $Id$
+# Public domain. Originally written by Karl Berry, 2021.
+# Run Xe(La)TeX unsafely, for pstricks/transparency. See man page for more.
+
+if test "x$1" = x--help; then
+ mydir=`dirname $0`
+ if test -r "$mydir"/xetex-unsafe; then
+ xu="$mydir"/xetex-unsafe
+ elif test -r "$mydir"/xetex-unsafe.sh; then
+ xu="$mydir"/xetex-unsafe.sh
+ else
+ echo "$0: can't find companion xetex-unsafe[.sh] for help msg?" >&2
+ exit 1
+ fi
+ exec "$xu" --help # don't want to duplicate help message.
+
+elif test "x$1" = x--version; then
+ echo "$Id$"
+ exit 0
+fi
+
+cmd=`echo "$0" | sed s/-unsafe//`
+exec "$cmd" -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" "$@"
diff --git a/Master/texmf-dist/scripts/texlive-extra/xetex-unsafe.sh b/Master/texmf-dist/scripts/texlive-extra/xetex-unsafe.sh
new file mode 100755
index 00000000000..e07493cd6c3
--- /dev/null
+++ b/Master/texmf-dist/scripts/texlive-extra/xetex-unsafe.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# $Id$
+# Public domain. Originally written by Karl Berry, 2021.
+# Run Xe(La)TeX unsafely, for pstricks/transparency. See man page for more.
+
+if test "x$1" = x--help; then
+ cat <<END_USAGE
+Usage: $0 [XETEX-ARGUMENT]...
+
+Run Xe(La)TeX unsafely, that is, using dvipdfmx-unsafe.cfg. All
+command-line arguments, except --help and --version, are passed as-is to
+Xe(La)TeX.
+
+As of TeX Live 2022, doing this is needed only when running XeTeX on
+documents using PSTricks features which require transparency. We
+recommend using Lua(La)TeX with PSTricks instead of XeTeX in this case.
+
+At all costs, avoid using this, or any, unsafe invocation with documents
+off the net or that are otherwise untrusted in any way.
+
+For more details on this, please see the xetex-unsafe(1) man page,
+or "texdoc xetex-unsafe".
+
+For more about XeTeX: https://tug.org/xetex
+For more about PSTricks: https://tug.org/PSTricks
+Email for xe(la)tex-unsafe specifically: https://lists.tug.org/dvipdfmx
+END_USAGE
+ echo '$Id$'
+ exit 0
+
+elif test "x$1" = x--version; then
+ echo '$Id$'
+ exit 0
+fi
+
+cmd=`echo "$0" | sed s/-unsafe//`
+exec "$cmd" -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" "$@"
diff --git a/Master/texmf-dist/scripts/texlive/README b/Master/texmf-dist/scripts/texlive/README
index 4758e0a84f0..f727fe3390d 100644
--- a/Master/texmf-dist/scripts/texlive/README
+++ b/Master/texmf-dist/scripts/texlive/README
@@ -2,13 +2,15 @@ $Id$
Master/texmf-dist/scripts/texlive
(This file is public domain.)
-This directory contains scripts for TeX Live. Unlike everything else
-under Master/texmf-dist/scripts, except scripts/texlive-extra, most of
-these scripts are actually maintained here, and not under Build.
+This directory contains scripts for TeX Live. The scripts here are in
+fact maintained here, and not under Build, unlike almost everything else
+under Master/texmf-dist/scripts. (The other directory of
+Master-maintained scripts is the sibling scripts/texlive-extra/.)
There are slave copies of these Master-maintained scripts in
Build/source/texk/texlive/linked_scripts, just as for the multitude of
-scripts updated from CTAN.
+scripts updated from CTAN. tlpkg/bin/tl-update-linked-scripts keeps
+them in sync; it's invoked from the nightly cron.
The man pages for the programs here, though, are still maintained in
Build/, since that is almost 100% true in TL, and it seems better not to
@@ -41,6 +43,6 @@ texlive-scripts - infraonly, important scripts (fmtutil, updmap,
texlive-scripts-extra - not infraonly, little-used scripts (allcm, allec,
texconfig, ...), changes pushed normally.
-The principal mailing list is http://lists.tug.org/tex-live.
+The principal mailing list is https://lists.tug.org/tex-live.
All of these scripts are free software, mostly public domain.
diff --git a/Master/tlpkg/bin/tl-update-linked-scripts b/Master/tlpkg/bin/tl-update-linked-scripts
index c589c8e24bb..dfdc3370cf4 100755
--- a/Master/tlpkg/bin/tl-update-linked-scripts
+++ b/Master/tlpkg/bin/tl-update-linked-scripts
@@ -10,7 +10,8 @@ Master=`cd $mydir/../.. && pwd`
compare_and_copy () {
for file in "$@"; do
#echo "comparing $Src/$file to $Dest..."
- echo "$file" | grep '/context.sh$' >/dev/null && continue # context in flux
+ # context is its own thing, don't try to handle here.
+ echo "$file" | grep '/context.sh$' >/dev/null && continue
cmp -s $Src/$file $Dest/$file && continue
diff --git a/Master/tlpkg/tlpsrc/texlive-scripts-extra.tlpsrc b/Master/tlpkg/tlpsrc/texlive-scripts-extra.tlpsrc
index b2be69cf82f..8d05890de8e 100644
--- a/Master/tlpkg/tlpsrc/texlive-scripts-extra.tlpsrc
+++ b/Master/tlpkg/tlpsrc/texlive-scripts-extra.tlpsrc
@@ -21,6 +21,8 @@ runpattern f texmf-dist/texconfig/g/*
runpattern f texmf-dist/texconfig/v/*
runpattern f texmf-dist/texconfig/x/*
+# list scripts individually since a few are included in other packages,
+# such as fontinst.
binpattern f bin/${ARCH}/allcm
binpattern f bin/${ARCH}/allcm
binpattern f bin/${ARCH}/allneeded
diff --git a/Master/tlpkg/tlpsrc/xetex.tlpsrc b/Master/tlpkg/tlpsrc/xetex.tlpsrc
index 57f8dc343b9..5fed3d59933 100644
--- a/Master/tlpkg/tlpsrc/xetex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/xetex.tlpsrc
@@ -1,5 +1,9 @@
category TLCore
+depend xetexconfig
+depend latex
+depend dvipdfmx
+
tlpsetvar fmtcomm cm,hyphen-base,tex-ini-files,unicode-data
#
execute AddFormat name=xetex engine=xetex patterns=language.def \
@@ -29,6 +33,9 @@ binpattern f bin/${ARCH}/xelatex
binpattern f bin/${ARCH}/xetex
binpattern f bin/${ARCH}/teckit_compile
-depend xetexconfig
-depend latex
-depend dvipdfmx
+# The wrappers that (eventually) invoke gs with unsafe options,
+# to support pstricks.
+runpattern f texmf-dist/scripts/texlive-extra/xetex-unsafe.sh
+runpattern f texmf-dist/scripts/texlive-extra/xelatex-unsafe.sh
+docpattern f texmf-dist/doc/man/man1/xelatex-unsafe.*
+docpattern f texmf-dist/doc/man/man1/xetex-unsafe.*