summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-07-04 20:27:41 +0000
committerKarl Berry <karl@freefriends.org>2024-07-04 20:27:41 +0000
commit091e6d6899a761f545328d2d31d4a1cb160574a3 (patch)
tree53f935bfaaa346a05b5464559e854f309e72f90d
parentfd9f91a2a72bed50ced2337fe42795c843c98f83 (diff)
lt3luabridge (4jul24)
git-svn-id: svn://tug.org/texlive/trunk@71704 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/generic/lt3luabridge/CHANGES.md74
-rw-r--r--Master/texmf-dist/doc/generic/lt3luabridge/README.md5
-rw-r--r--Master/texmf-dist/doc/generic/lt3luabridge/docstrip.cfg2
-rw-r--r--Master/texmf-dist/doc/generic/lt3luabridge/lt3luabridge.pdfbin497075 -> 505015 bytes
-rw-r--r--Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx87
-rw-r--r--Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.sty6
-rw-r--r--Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.tex67
-rw-r--r--Master/texmf-dist/tex/generic/lt3luabridge/t-lt3luabridge.tex2
8 files changed, 221 insertions, 22 deletions
diff --git a/Master/texmf-dist/doc/generic/lt3luabridge/CHANGES.md b/Master/texmf-dist/doc/generic/lt3luabridge/CHANGES.md
new file mode 100644
index 00000000000..470ad7441dc
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/lt3luabridge/CHANGES.md
@@ -0,0 +1,74 @@
+# Changes
+
+## 2.2.0 (2024-07-03)
+
+Development:
+
+- Automatically determine value of `\c_luabridge_default_output_dirname_str`
+ based on the current output directory.
+ (witiko/markdown#457, #26, #27, reported by @hongy19)
+
+Continuous Integration:
+
+- Automatically test the library on both Linux and Windows.
+
+## 2.1.0 (2024-02-14)
+
+Development:
+
+- Define function `\luabridge_tl_set:Nn`.
+
+## 2.0.2 (2022-10-24)
+
+Fixes:
+
+- Fix tokenization in error-reporting code. (#17, #19)
+- Catch compilation errors in TeX engines other than LuaTeX. (#18, #20)
+
+Refactoring:
+
+- Remove useless uses of `\l_tmpb_tl`. (24e116d)
+
+## 2.0.1 (2022-08-16)
+
+Fixes:
+
+- Apply proper error handling when executing Lua via shell escape. (#15)
+
+## 2.0.0 (2022-08-08)
+
+Breaking Changes:
+
+- Use `\sys_get_shell:nnNTF` from l3sys instead of `\immediate\write18` and
+ `os.execute()`. (#13)
+ - Merges `\c_luabridge_method_write_eighteen_int` and
+ `\c_luabridge_method_os_execute_int` into
+ `\c_luabridge_method_shell_int`.
+ - Removes `\g_luabridge_standard_output_filename_str` and
+ `\c_luabridge_default_standard_output_filename_str`.
+
+Fixes:
+
+- Execute chunks that end with `end` or a Lua comment. (#11, #14)
+- Sandbox direct Lua access. (#11, #14)
+- Make nested calls defined behavior. (#8, #13)
+
+Refactoring:
+
+- Remove needless whitespaces in Lua code.
+- Replace (plain) TeX primitives with `\iow_*` l3file functions. (#1, #3,
+ latex3/latex3#1105, latex3/latex3#1114. latex3/latex3#1117)
+ - Many thanks to @josephwright, @u-fischer, and @FrankMittelbach at
+ latex3/latex3#1114, and Hans Hagen, @hmenke, and @mojca at
+ [dev-context][1] for helping to make l3file compatible with ConTeXt MkII.
+
+ [1]: https://mailman.ntg.nl/pipermail/dev-context/2022/003912.html
+ (A robust way of detecting ConTeXt from LaTeX3)
+
+## 1.0.1 (2022-06-27)
+
+This release includes PDF documentation of lt3luabridge.
+
+## 1.0.0 (2022-06-26)
+
+Initial release
diff --git a/Master/texmf-dist/doc/generic/lt3luabridge/README.md b/Master/texmf-dist/doc/generic/lt3luabridge/README.md
index a9257f4e09d..2a8f4e5125f 100644
--- a/Master/texmf-dist/doc/generic/lt3luabridge/README.md
+++ b/Master/texmf-dist/doc/generic/lt3luabridge/README.md
@@ -23,3 +23,8 @@ available as a separate package.
[2]: https://www.ctan.org/pkg/markdown
[3]: https://github.com/witiko/markdown/pull/141
[4]: https://github.com/Witiko/lt3luabridge/actions
+
+## Additional information
+
+- Author: Vít Starý Novotný <witiko@mail.muni.cz>
+- License: LaTeX Project Public License (LPPL) 1.3c
diff --git a/Master/texmf-dist/doc/generic/lt3luabridge/docstrip.cfg b/Master/texmf-dist/doc/generic/lt3luabridge/docstrip.cfg
index e562506f72c..7298ba5794e 100644
--- a/Master/texmf-dist/doc/generic/lt3luabridge/docstrip.cfg
+++ b/Master/texmf-dist/doc/generic/lt3luabridge/docstrip.cfg
@@ -1,6 +1,6 @@
\preamble
-Copyright (C) 2016-2024 Vít Novotný
+Copyright (C) 2016-2024 Vít Starý Novotný
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
diff --git a/Master/texmf-dist/doc/generic/lt3luabridge/lt3luabridge.pdf b/Master/texmf-dist/doc/generic/lt3luabridge/lt3luabridge.pdf
index 2972fad79fa..6370f4dbccc 100644
--- a/Master/texmf-dist/doc/generic/lt3luabridge/lt3luabridge.pdf
+++ b/Master/texmf-dist/doc/generic/lt3luabridge/lt3luabridge.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx b/Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx
index 67cc73c7387..d8bb7a3beec 100644
--- a/Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx
+++ b/Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-14}
+% \date{Released 2024-07-03}
%
% \maketitle
%
@@ -151,7 +151,7 @@
% \texttt{-output-directory} parameter of the \TeX{} engine.
% \end{variable}
%
-% \begin{variable}[added = 2022-06-26]{\c_luabridge_default_output_dirname_str}
+% \begin{variable}[added = 2022-06-26, updated = 2024-07-03]{\c_luabridge_default_output_dirname_str}
% This constant is the default value of \cs{g_luabridge_output_dirname_str}.
% \end{variable}
%
@@ -261,9 +261,42 @@
=
{ \c_luabridge_method_shell_int }
{
- \str_const:Nn
- \c_luabridge_default_output_dirname_str
- { . }
+% \end{macrocode}
+%
+% Instead of assuming the current working directory as the output directory,
+% try to determine the output directory from the environmental variable
+% \texttt{TEXMF_OUTPUT_DIRECTORY}, which is automatically defined by \TeX{}
+% engines and accessible from child processes.
+%
+% \begin{macrocode}
+ \sys_if_platform_unix:TF
+ {
+ \str_const:Nn
+ \c_luabridge_default_output_dirname_str
+ { $TEXMF_OUTPUT_DIRECTORY }
+ }
+ {
+ \sys_if_platform_windows:TF
+ {
+ \str_set:Nn
+ \l_tmpa_str
+ { TEXMF_OUTPUT_DIRECTORY }
+ \str_put_left:NV
+ \l_tmpa_str
+ \c_percent_str
+ \str_put_right:NV
+ \l_tmpa_str
+ \c_percent_str
+ \str_const:NV
+ \c_luabridge_default_output_dirname_str
+ \l_tmpa_str
+ }
+ {
+ \str_const:Nn
+ \c_luabridge_default_output_dirname_str
+ { . }
+ }
+ }
\str_const:Nx
\c_luabridge_default_helper_script_filename_str
{ \jobname.luabridge.lua }
@@ -358,9 +391,43 @@
\g_luabridge_helper_script_filename_str
\sys_get_shell:xnNTF
{
- texlua~
- \g_luabridge_output_dirname_str /
- \g_luabridge_helper_script_filename_str
+% \end{macrocode}
+%
+% If the environmental variable \texttt{TEXMF_OUTPUT_DIRECTORY} is undefined,
+% use the current working directory (\texttt{.}) instead.
+%
+% \begin{macrocode}
+ \str_if_eq:NNTF
+ \g_luabridge_output_dirname_str
+ \c_luabridge_default_output_dirname_str
+ {
+ \sys_if_platform_windows:TF
+ {
+ if~not~defined~TEXMF_OUTPUT_DIRECTORY~(
+ texlua~
+ \g_luabridge_helper_script_filename_str
+ )~else~(
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ )
+ }
+ {
+ \sys_if_platform_unix:T
+ {
+ TEXMF_OUTPUT_DIRECTORY =
+ ${TEXMF_OUTPUT_DIRECTORY:-.} \iow_newline:
+ }
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ }
+ }
+ {
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ }
}
{ }
#1
@@ -492,8 +559,8 @@
\RequirePackage{expl3}
\ProvidesExplPackage
{lt3luabridge}%
- {2024-02-14}%
- {2.1.0}%
+ {2024-07-03}%
+ {2.2.0}%
{An expl3 package that allows you to execute Lua code in LuaTeX or any other
TeX engine that exposes the shell}
\input lt3luabridge\relax
diff --git a/Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.sty b/Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.sty
index 7f3827b207b..61d4f2d20c2 100644
--- a/Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.sty
+++ b/Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.sty
@@ -6,7 +6,7 @@
%%
%% lt3luabridge.dtx (with options: `latex-package')
%%
-%% Copyright (C) 2016-2024 Vít Novotný
+%% Copyright (C) 2016-2024 Vít Starý Novotný
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -45,8 +45,8 @@
\RequirePackage{expl3}
\ProvidesExplPackage
{lt3luabridge}%
- {2024-02-14}%
- {2.1.0}%
+ {2024-07-03}%
+ {2.2.0}%
{An expl3 package that allows you to execute Lua code in LuaTeX or any other
TeX engine that exposes the shell}
\input lt3luabridge\relax
diff --git a/Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.tex b/Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.tex
index 256456220e0..26d3dc6a0b9 100644
--- a/Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.tex
+++ b/Master/texmf-dist/tex/generic/lt3luabridge/lt3luabridge.tex
@@ -6,7 +6,7 @@
%%
%% lt3luabridge.dtx (with options: `generic-package')
%%
-%% Copyright (C) 2016-2024 Vít Novotný
+%% Copyright (C) 2016-2024 Vít Starý Novotný
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -117,9 +117,34 @@
=
{ \c_luabridge_method_shell_int }
{
- \str_const:Nn
- \c_luabridge_default_output_dirname_str
- { . }
+ \sys_if_platform_unix:TF
+ {
+ \str_const:Nn
+ \c_luabridge_default_output_dirname_str
+ { $TEXMF_OUTPUT_DIRECTORY }
+ }
+ {
+ \sys_if_platform_windows:TF
+ {
+ \str_set:Nn
+ \l_tmpa_str
+ { TEXMF_OUTPUT_DIRECTORY }
+ \str_put_left:NV
+ \l_tmpa_str
+ \c_percent_str
+ \str_put_right:NV
+ \l_tmpa_str
+ \c_percent_str
+ \str_const:NV
+ \c_luabridge_default_output_dirname_str
+ \l_tmpa_str
+ }
+ {
+ \str_const:Nn
+ \c_luabridge_default_output_dirname_str
+ { . }
+ }
+ }
\str_const:Nx
\c_luabridge_default_helper_script_filename_str
{ \jobname.luabridge.lua }
@@ -207,9 +232,37 @@
\g_luabridge_helper_script_filename_str
\sys_get_shell:xnNTF
{
- texlua~
- \g_luabridge_output_dirname_str /
- \g_luabridge_helper_script_filename_str
+ \str_if_eq:NNTF
+ \g_luabridge_output_dirname_str
+ \c_luabridge_default_output_dirname_str
+ {
+ \sys_if_platform_windows:TF
+ {
+ if~not~defined~TEXMF_OUTPUT_DIRECTORY~(
+ texlua~
+ \g_luabridge_helper_script_filename_str
+ )~else~(
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ )
+ }
+ {
+ \sys_if_platform_unix:T
+ {
+ TEXMF_OUTPUT_DIRECTORY =
+ ${TEXMF_OUTPUT_DIRECTORY:-.} \iow_newline:
+ }
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ }
+ }
+ {
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ }
}
{ }
#1
diff --git a/Master/texmf-dist/tex/generic/lt3luabridge/t-lt3luabridge.tex b/Master/texmf-dist/tex/generic/lt3luabridge/t-lt3luabridge.tex
index ac4eed7372b..35e6ab1e8ab 100644
--- a/Master/texmf-dist/tex/generic/lt3luabridge/t-lt3luabridge.tex
+++ b/Master/texmf-dist/tex/generic/lt3luabridge/t-lt3luabridge.tex
@@ -6,7 +6,7 @@
%%
%% lt3luabridge.dtx (with options: `context-package')
%%
-%% Copyright (C) 2016-2024 Vít Novotný
+%% Copyright (C) 2016-2024 Vít Starý Novotný
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c