texlive[64790] Master/texmf-dist: iexec (23oct22)
commits+karl at tug.org
commits+karl at tug.org
Sun Oct 23 22:36:54 CEST 2022
Revision: 64790
http://tug.org/svn/texlive?view=revision&revision=64790
Author: karl
Date: 2022-10-23 22:36:54 +0200 (Sun, 23 Oct 2022)
Log Message:
-----------
iexec (23oct22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/iexec/iexec.pdf
trunk/Master/texmf-dist/source/latex/iexec/iexec.dtx
trunk/Master/texmf-dist/tex/latex/iexec/iexec.sty
Modified: trunk/Master/texmf-dist/doc/latex/iexec/iexec.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/iexec/iexec.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/iexec/iexec.dtx 2022-10-23 20:36:42 UTC (rev 64789)
+++ trunk/Master/texmf-dist/source/latex/iexec/iexec.dtx 2022-10-23 20:36:54 UTC (rev 64790)
@@ -50,12 +50,13 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{iexec}
%<*package>
-[2022-10-22 0.11.0 Inputable Shell Executions]
+[2022-10-23 0.11.1 Inputable Shell Executions]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage[tt=false, type1=true]{libertine}
\usepackage{microtype}
+\usepackage{xcolor}
\usepackage[dtx]{docshots}
\usepackage{iexec}
\usepackage{href-ul}
@@ -77,6 +78,9 @@
%
% \maketitle
%
+% \textbf{\color{red}NB!}
+% This package doesn't work on Windows!
+%
% \section{Introduction}
%
% This package helps you execute shell commands right from the
@@ -324,7 +328,7 @@
\fi%
\begingroup%
% \end{macrocode}
-% Then, start the log from a clean line:
+% Then, we start the log from a clean line:
% \begin{macrocode}
\ifdefined\iexec at log%
\message{^^J}%
@@ -339,20 +343,21 @@
\let\{\@charlb%
\let\}\@charrb%
% \end{macrocode}
-% Then, we execute it:
+% Then, we execute it and save exit code into a file (where we also add \% in order to trim the content to exactly one number, as suggested \href{https://tex.stackexchange.com/questions/662756}{here}):
% \changes{0.10.0}{2022/10/19}{The ability to track exit code was added. Now, the code is saved into "iexec.ret" file, which is then read and checked for zero value.}
% \changes{0.8.0}{2022/10/05}{The option "null" was introduced, allowing redirection of stdout to "/dev/null". Doesn't work on Windows, though.}
% \changes{0.9.0}{2022/10/15}{The option "stderr" was introduced, allowing redirection of stderr to a file. Without this option specified, stderr will go to stdout.}
% \changes{0.11.0}{2022/10/22}{The file with exit code now contains just numbers, without end of line.}
+% \changes{0.11.1}{2022/10/23}{When exit code is printed to the file, we add percentchar at the end of line in order to avoid extra space when reading it back.}
% \begin{macrocode}
\def\iexec at cmd{(#2)
\ifdefined\iexec at append>\fi>
\ifdefined\iexec at null/dev/null\else\iexec at stdout\fi
\space\ifdefined\iexec at stderr2>\iexec at stderr\else2>&1\fi;
- /bin/echo -n $? >\iexec at exit}
+ /bin/echo -n $?\% >\iexec at exit}
\ShellEscape{\iexec at cmd}%
% \end{macrocode}
-% Then, a message is printed to TeX log:
+% Then, a message is printed to \TeX{} log:
% \begin{macrocode}
\ifdefined\iexec at log%
\message{iexec: [\iexec at cmd]^^J}%
@@ -359,7 +364,7 @@
\fi%
\endgroup%
% \end{macrocode}
-% Then, if required, the content of the stdout file will be printed to the log:
+% Then, if required, we print the content of the stdout file to \TeX{} log:
% \begin{macrocode}
\ifdefined\iexec at null\else%
\ifdefined\iexec at log%
@@ -368,11 +373,14 @@
\message{<EOF>^^J}%
\fi\fi%
% \end{macrocode}
-% Then, we check exit code, unless there is |ignore| option:
+% Then, we read back the exit code, from the file:
% \begin{macrocode}
\immediate\openin\iexec at exitfile=\iexec at exit%
\read\iexec at exitfile to \iexec at code%
\immediate\closein\iexec at exitfile%
+% \end{macrocode}
+% Then, we check whether it's zero or not (if not zero, we either print a message or fail the build, depending on the presence of |ignore| option):
+% \begin{macrocode}
\ifnum\iexec at code=0\else%
\ifdefined\iexec at ignore%
\ifdefined\iexec at log%
@@ -385,7 +393,7 @@
\fi%
\fi%
% \end{macrocode}
-% Then, include the produced output into the current document:
+% Then, we include the produced output into the current document:
% \begin{macrocode}
\ifdefined\iexec at null\else%
\ifdefined\iexec at quiet%
@@ -406,7 +414,7 @@
was included into the document^^J}%
\fi\fi%
% \end{macrocode}
-% Finally, delete the file or leave it untouched:
+% Finally, we delete the file or leave it untouched:
% \begin{macrocode}
\ifdefined\iexec at null\else%
\ifiexec at trace%
Modified: trunk/Master/texmf-dist/tex/latex/iexec/iexec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/iexec/iexec.sty 2022-10-23 20:36:42 UTC (rev 64789)
+++ trunk/Master/texmf-dist/tex/latex/iexec/iexec.sty 2022-10-23 20:36:54 UTC (rev 64790)
@@ -31,7 +31,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{iexec}
-[2022-10-22 0.11.0 Inputable Shell Executions]
+[2022-10-23 0.11.1 Inputable Shell Executions]
@@ -110,7 +110,7 @@
\ifdefined\iexec at append>\fi>
\ifdefined\iexec at null/dev/null\else\iexec at stdout\fi
\space\ifdefined\iexec at stderr2>\iexec at stderr\else2>&1\fi;
- /bin/echo -n $? >\iexec at exit}
+ /bin/echo -n $?\% >\iexec at exit}
\ShellEscape{\iexec at cmd}%
\ifdefined\iexec at log%
\message{iexec: [\iexec at cmd]^^J}%
More information about the tex-live-commits
mailing list.