diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-23 21:51:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-23 21:51:29 +0000 |
commit | dd06d4496374d098aa8082c27f4ebfe8ab0bdab1 (patch) | |
tree | f7a3b30a06ba59b8753a22dd03ce4bb59ca2411c /Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx | |
parent | eeab732aae7905ef02132ea5cd0571c63a420726 (diff) |
l3kernel (22oct19)
git-svn-id: svn://tug.org/texlive/trunk@52510 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index 03b55440163..199db4a628d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-10-14} +% \date{Released 2019-10-21} % % \maketitle % @@ -183,6 +183,13 @@ % Resets the timer used by |l3kernel.elapsetime|. % \end{function} % +% \begin{function}{l3kernel.shellescape} +% \begin{syntax} +% |l3kernel.shellescape(|\meta{cmd}|)| +% \end{syntax} +% Executes the \meta{cmd} and prints to the log as for \pdfTeX{}. +% \end{function} +% % \begin{function}{l3kernel.strcmp} % \begin{syntax} % |l3kernel.strcmp(|\meta{str one}, \meta{str two}|)| @@ -311,6 +318,7 @@ local md5 = md5 local os = os local string = string local tex = tex +local texio = texio local unicode = unicode % \end{macrocode} % @@ -326,10 +334,12 @@ local md5_sum = md5.sum local open = io.open local os_clock = os.clock local os_date = os.date +local os_exec = os.execute local setcatcode = tex.setcatcode local sprint = tex.sprint local cprint = tex.cprint local write = tex.write +local write_nl = texio.write_nl % \end{macrocode} % % Newer Con\TeX{}t releases replace the |unicode| library by |utf|. @@ -492,6 +502,23 @@ l3kernel.strcmp = strcmp % \end{macrocode} % \end{macro} % +% \begin{macro}{l3kernel.shellescape} +% Replicating the \pdfTeX{} log interaction for shell escape. +% \begin{macrocode} +local function shellescape(cmd) + local status,msg = os_exec(cmd) + if status == nil then + write_nl("log","runsystem(" .. cmd .. ")...(" .. msg .. ")\n") + elseif status == 0 then + write_nl("log","runsystem(" .. cmd .. ")...executed\n") + else + write_nl("log","runsystem(" .. cmd .. ")...failed " .. (msg or "") .. "\n") + end +end +l3kernel.shellescape = shellescape +% \end{macrocode} +% \end{macro} +% % \subsection{Generic \Lua{} and font support} % % \begin{macrocode} |