texlive[45533] Master/texmf-dist: ifplatform (13oct17)
commits+karl at tug.org
commits+karl at tug.org
Fri Oct 13 23:40:27 CEST 2017
Revision: 45533
http://tug.org/svn/texlive?view=revision&revision=45533
Author: karl
Date: 2017-10-13 23:40:26 +0200 (Fri, 13 Oct 2017)
Log Message:
-----------
ifplatform (13oct17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/ifplatform/README
trunk/Master/texmf-dist/doc/latex/ifplatform/ifplatform.pdf
trunk/Master/texmf-dist/source/latex/ifplatform/ifplatform.dtx
trunk/Master/texmf-dist/source/latex/ifplatform/ifplatform.ins
trunk/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty
Modified: trunk/Master/texmf-dist/doc/latex/ifplatform/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ifplatform/README 2017-10-13 06:50:59 UTC (rev 45532)
+++ trunk/Master/texmf-dist/doc/latex/ifplatform/README 2017-10-13 21:40:26 UTC (rev 45533)
@@ -1,6 +1,6 @@
______________________
The IFPLATFORM package
-v0.4 2010/10/22
+v0.4a 2017/10/13
This package uses heuristics to establish whether
the document is being processed on Windows or a *NIX
@@ -22,6 +22,6 @@
Will Robertson wspr 81 at gmail dot com
Johannes Große
-Copyright 2007-2010 Will Robertson
+Copyright 2007-2017 Will Robertson
Copyright 2007 Johannes Große
Distributed under the LaTeX Project Public License
Modified: trunk/Master/texmf-dist/doc/latex/ifplatform/ifplatform.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/ifplatform/ifplatform.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/ifplatform/ifplatform.dtx 2017-10-13 06:50:59 UTC (rev 45532)
+++ trunk/Master/texmf-dist/source/latex/ifplatform/ifplatform.dtx 2017-10-13 21:40:26 UTC (rev 45533)
@@ -1,36 +1,7 @@
-%\iffalse
+%\iffalse
%<*internal>
\iffalse
%</internal>
-%<*readme>
-______________________
-The IFPLATFORM package
-v0.4 2010/10/22
-
-This package uses heuristics to establish whether
-the document is being processed on Windows or a *NIX
-platform (Mac OS X, Linux, etc.).
-
-Except if you're using LuaTeX where this information
-is already known. Otherwise, shell escape is required
-to differentiate different *NIX platforms.
-
-Booleans provided are:
- - ifwindows
- - iflinux
- - ifmacosx
- - ifcygwin
-
-Finally, the \platformname macro is also provided that
-expands to a string of the platform name.
-
-Will Robertson wspr 81 at gmail dot com
-Johannes Große
-
-Copyright 2007-2010 Will Robertson
-Copyright 2007 Johannes Große
-Distributed under the LaTeX Project Public License
-%</readme>
%<*internal>
\fi
\begingroup
@@ -40,11 +11,11 @@
\keepsilent
\preamble
________________________________________________________
- Copyright (C) 2007-2010 Will Robertson & Johannes Große
+ Copyright (C) 2007-2017 Will Robertson & Johannes Große
License information appended.
\endpreamble
\postamble
-Copyright (C) 2007-2010 by Will Robertson & Johannes Große
+Copyright (C) 2007-2017 by Will Robertson & Johannes Große
Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
@@ -54,7 +25,7 @@
This work consists of the file ifplatform.dtx
and the derived files ifplatform.pdf,
- ifplatform.sty, and
+ ifplatform.sty, and
ifplatform.ins.
\endpostamble
\askforoverwritefalse
@@ -64,7 +35,6 @@
%<*internal>
\generate{\file{\jobname.ins}{\from{\jobname.dtx}{batchfile}}}
\nopreamble\nopostamble
-\generate{\file{README.txt}{\from{\jobname.dtx}{readme}}}
\endgroup
\immediate\write18{makeindex -s gind.ist -o \jobname.ind \jobname.idx}
\immediate\write18{makeindex -s gglo.ist -o \jobname.gls \jobname.glo}
@@ -110,8 +80,8 @@
% \author{Original code by Johannes Gro\ss{}e\\
% Package by Will Robertson\\
% \color[gray]{0.5}
-% \texttt{wspr\,81\,at\,gmail\,dot\,com}}
-% \date{\fileversion\thanks{Thanks to Ken Brown, Joseph Wright, Zebb Prime, and others for testing this version.}\qquad \filedate}
+% \texttt{http://github.com/wspr/ifplatform}}
+% \date{\fileversion\thanks{Thanks to Ken Brown, Joseph Wright, Zebb Prime, and others for testing this package.}\qquad \filedate}
%
% \maketitle
%
@@ -125,14 +95,14 @@
% \item \cs{ifmacosx}
% \item \cs{ifcygwin}
% \end{itemize}
-% If you only wish to detect \cs{ifwindows}, then it does not matter how you
-% load this package. Note then that use of (Linux \emph{or} \macosxname\ \emph{or} Cygwin) can
+% If you only wish to detect \cs{ifwindows}, then it does not matter how you
+% load this package. Note then that use of (Linux \emph{or} \macosxname\ \emph{or} Cygwin) can
% then be detected with \cs{ifwindows}\cs{else}.
-%
+%
% If you also wish to determine the difference between which Unix-variant
% you are using (i.e., also detect \cs{iflinux}, \cs{ifmacosx}, and \cs{ifcygwin}) then shell
% escape must be enabled.
-% This is achieved by using the |-shell-escape| command line option when
+% This is achieved by using the |-shell-escape| command line option when
% executing \LaTeX.
%
% If shell escape is not enabled, \cs{iflinux}, \cs{ifmacosx}, and \cs{ifcygwin} will all return \emph{false}. A warning will be printed in the console output to remind you in this case.
@@ -140,13 +110,13 @@
% \section{Auxiliary features}
%
% \cs{ifshellescape} is provided as a conditional to test whether
-% shell escape is active or not. (Note: new versions of pdf\/\TeX\
+% shell escape is active or not. (Note: new versions of pdf\/\TeX\
% allow you to query shell escape with \verb|\ifnum\pdfshellescape>0|\,,
-% and the \pkg{pdftexcmds} provides the wrapper \cs{pdf at shellescape}
+% and the \pkg{pdftexcmds} package provides the wrapper \cs{pdf at shellescape}
% which works with \hologo{XeTeX}, \hologo{pdfTeX}, and \hologo{LuaTeX}.)
%
-% Also, the \cmd\platformname\ command is defined to expand to a
-% macro that represents the operating system. Default definitions are
+% Also, the \cmd\platformname\ command is defined to expand to a
+% macro that represents the operating system. Default definitions are
% (respectively):
% \begin{quote}
% \begin{tabular}{@{}l@{\quad$\to$\quad}l}
@@ -213,15 +183,15 @@
%
% \item When both null files are detected (i.e., things aren't right with one of the two tests above), \pkg{ifplatform} uses another test to try and sort itself out. For interest, the test is: `|echo # > \jobname.w18|'. Under Windows you should end up with a text file containing an octothorpe. On *nix, the |#| will be seen as a comment char and the test will be ignored and the file will not be written.
%
-% This `last resort' test will fail if shell escape is not enabled, or if the file |\jobname.w18|
+% This `last resort' test will fail if shell escape is not enabled, or if the file |\jobname.w18|
% somehow already exists, or if the behaviour of |#| isn't as reliable as I think.
%
% \item Note that if you're running \TeX\ binaries from Cygwin on Windows, then your platform will \emph{not} be Windows. It will appear to be a *nix system, with platform name `Cygwin'.
%
% \item If you ever see the error
-% \begin{quote}\ttfamily I can't tell if this is Windows or *nix; you
+% \begin{quote}\ttfamily I can't tell if this is Windows or *nix; you
% appear to be neither.\end{quote}
-% then I'd dearly like to know how it happened. It should
+% then I'd dearly like to know how it happened. It should
% never occur, as far as I know.
% (Update: in previous versions of this package, this message appeared when running under \hologo{LuaTeX}.)
% \end{itemize}
@@ -236,11 +206,11 @@
%\fi
% \begin{macrocode}
\ProvidesPackage{ifplatform}
- [2010/10/22 v0.4 Testing for the operating system]
+ [2017/10/13 v0.4a Testing for the operating system]
% \end{macrocode}
% Packages required: (thanks Heiko)
% \begin{macrocode}
-\RequirePackage{pdftexcmds,catchfile,ifluatex}
+\RequirePackage{shellesc,pdftexcmds,catchfile,ifluatex}
% \end{macrocode}
% Conditionals we provide:
% \begin{macrocode}
@@ -283,10 +253,10 @@
\shellescapetrue
\else
\ifluatex\else
- \PackageWarningNoLine{ifplatform}{^^J \space\space\space
- shell escape is disabled,
- so I can only detect \@backslashchar ifwindows%
- }
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ shell escape is disabled,
+ so I can only detect \@backslashchar ifwindows%
+ }
\fi
\fi
% \end{macrocode}
@@ -304,7 +274,7 @@
% \begin{macrocode}
\ifluatex
\csname\directlua{
- if os.type == "unix" then
+ if os.type == "unix" then
tex.sprint("@ip at nix@true")
elseif os.type == "windows" then
tex.sprint("windowstrue")
@@ -312,13 +282,13 @@
}\endcsname
\else
% \end{macrocode}
-% Otherwise we need to
+% Otherwise we need to
% test for the null files of Windows and *nix.
% (This doesn't work at all in LuaTeX. Not sure why; haven't looked.)
% In a normal situation, this is all we need to do:
% \begin{macrocode}
-\IfFileExists{nul:}{\@ip at nix@false}{\@ip at nix@true}
-\IfFileExists{/dev/null}{\windowsfalse}{\windowstrue}
+ \IfFileExists{nul:}{\@ip at nix@false}{\@ip at nix@true}
+ \IfFileExists{/dev/null}{\windowsfalse}{\windowstrue}
% \end{macrocode}
% \begin{table}
% \centering
@@ -352,43 +322,43 @@
% \end{itemize}
% Here's the code for the above `last resort' test:
% \begin{macrocode}
-\edef\ip at windows@echo at test{echo \string# > "\ip at file"}
-\def\ip at backupplan{%
- \IfFileExists{\ip at file}{%
- \PackageWarningNoLine{ifplatform}{^^J \space\space\space
- Please delete the file "\ip at file" and try again%
- }%
- \ip at cantdecide
- }{%
- \immediate\write18{\ip at windows@echo at test}%
+ \edef\ip at windows@echo at test{echo \string# > "\ip at file"}
+ \def\ip at backupplan{%
\IfFileExists{\ip at file}{%
- \immediate\write18{del "\ip at file"}%
- \windowstrue
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ Please delete the file "\ip at file" and try again%
+ }%
+ \ip at cantdecide
}{%
- \@ip at nix@true
+ \ShellEscape{\ip at windows@echo at test}%
+ \IfFileExists{\ip at file}{%
+ \ShellEscape{del "\ip at file"}%
+ \windowstrue
+ }{%
+ \@ip at nix@true
+ }%
}%
- }%
-}
+ }
% \end{macrocode}
% Now we use some odd logic to deduce what's happening in the edge cases when things go wrong: (see table~\ref{tbl})
% \begin{macrocode}
-\ifwindows
- \if at ip@nix@
- \PackageWarningNoLine{ifplatform}{^^J \space\space\space
- I can't tell if this is Windows or *nix;
- you appear to be neither%
- }
- \fi
-\else
- \if at ip@nix@\else
- \ifshellescape
- \ip at backupplan
- \else
- \ip at cantdecide
+ \ifwindows
+ \if at ip@nix@
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ I can't tell if this is Windows or *nix;
+ you appear to be neither%
+ }
\fi
+ \else
+ \if at ip@nix@\else
+ \ifshellescape
+ \ip at backupplan
+ \else
+ \ip at cantdecide
+ \fi
+ \fi
\fi
\fi
-\fi
% \end{macrocode}
% Needed below:
% \begin{macrocode}
@@ -401,16 +371,15 @@
% Now test for the others; directly test for Linux and Mac\,OS\,X; but what about Solaris or FreeBSD or \dots\ ?
% Define \cmd\unknownplatform\ as the output of |uname| rather than enumerate the possibilities.
% \begin{macrocode}
-\if at ip@nix@
-\ifshellescape
+\if at ip@nix@\ifshellescape
\ifwindows\else
- \immediate\write18{uname -s > "\ip at file"}
+ \ShellEscape{uname -s > "\ip at file"}
\CatchFileDef\@tempa{\ip at file}{}
- \immediate\write18{rm -- "\ip at file"}
+ \ShellEscape{rm -- "\ip at file"}
% \end{macrocode}
% Kill a trailing space:
% \begin{macrocode}
- \edef\@tempa{\expandafter\zap at space\@tempa\@empty}
+ \edef\@tempa{\expandafter\zap at space\@tempa\@empty}
\def\@tempb{Linux}
\ifx\@tempa\@tempb
\linuxtrue
Modified: trunk/Master/texmf-dist/source/latex/ifplatform/ifplatform.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/ifplatform/ifplatform.ins 2017-10-13 06:50:59 UTC (rev 45532)
+++ trunk/Master/texmf-dist/source/latex/ifplatform/ifplatform.ins 2017-10-13 21:40:26 UTC (rev 45533)
@@ -6,17 +6,17 @@
%%
%% ifplatform.dtx (with options: `batchfile')
%% ________________________________________________________
-%% Copyright (C) 2007-2010 Will Robertson & Johannes Große
+%% Copyright (C) 2007-2017 Will Robertson & Johannes Große
%% License information appended.
\input docstrip.tex
\keepsilent
\preamble
________________________________________________________
- Copyright (C) 2007-2010 Will Robertson & Johannes Große
+ Copyright (C) 2007-2017 Will Robertson & Johannes Große
License information appended.
\endpreamble
\postamble
-Copyright (C) 2007-2010 by Will Robertson & Johannes Große
+Copyright (C) 2007-2017 by Will Robertson & Johannes Große
Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
@@ -32,7 +32,7 @@
\askforoverwritefalse
\generate{\file{ifplatform.sty}{\from{ifplatform.dtx}{package}}}
\endbatchfile
-%% Copyright (C) 2007-2010 by Will Robertson & Johannes Große
+%% Copyright (C) 2007-2017 by Will Robertson & Johannes Große
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
Modified: trunk/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty 2017-10-13 06:50:59 UTC (rev 45532)
+++ trunk/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty 2017-10-13 21:40:26 UTC (rev 45533)
@@ -6,11 +6,11 @@
%%
%% ifplatform.dtx (with options: `package')
%% ________________________________________________________
-%% Copyright (C) 2007-2010 Will Robertson & Johannes Gro^^c3^^9fe
+%% Copyright (C) 2007-2017 Will Robertson & Johannes Gro^^c3^^9fe
%% License information appended.
\ProvidesPackage{ifplatform}
- [2010/10/22 v0.4 Testing for the operating system]
-\RequirePackage{pdftexcmds,catchfile,ifluatex}
+ [2017/10/13 v0.4a Testing for the operating system]
+\RequirePackage{shellesc,pdftexcmds,catchfile,ifluatex}
\newif\ifshellescape
\newif\ifwindows
\newif\ifmacosx
@@ -28,10 +28,10 @@
\shellescapetrue
\else
\ifluatex\else
- \PackageWarningNoLine{ifplatform}{^^J \space\space\space
- shell escape is disabled,
- so I can only detect \@backslashchar ifwindows%
- }
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ shell escape is disabled,
+ so I can only detect \@backslashchar ifwindows%
+ }
\fi
\fi
\def\ip at cantdecide{%
@@ -49,49 +49,48 @@
end
}\endcsname
\else
-\IfFileExists{nul:}{\@ip at nix@false}{\@ip at nix@true}
-\IfFileExists{/dev/null}{\windowsfalse}{\windowstrue}
-\edef\ip at windows@echo at test{echo \string# > "\ip at file"}
-\def\ip at backupplan{%
- \IfFileExists{\ip at file}{%
- \PackageWarningNoLine{ifplatform}{^^J \space\space\space
- Please delete the file "\ip at file" and try again%
- }%
- \ip at cantdecide
- }{%
- \immediate\write18{\ip at windows@echo at test}%
+ \IfFileExists{nul:}{\@ip at nix@false}{\@ip at nix@true}
+ \IfFileExists{/dev/null}{\windowsfalse}{\windowstrue}
+ \edef\ip at windows@echo at test{echo \string# > "\ip at file"}
+ \def\ip at backupplan{%
\IfFileExists{\ip at file}{%
- \immediate\write18{del "\ip at file"}%
- \windowstrue
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ Please delete the file "\ip at file" and try again%
+ }%
+ \ip at cantdecide
}{%
- \@ip at nix@true
+ \ShellEscape{\ip at windows@echo at test}%
+ \IfFileExists{\ip at file}{%
+ \ShellEscape{del "\ip at file"}%
+ \windowstrue
+ }{%
+ \@ip at nix@true
+ }%
}%
- }%
-}
-\ifwindows
- \if at ip@nix@
- \PackageWarningNoLine{ifplatform}{^^J \space\space\space
- I can't tell if this is Windows or *nix;
- you appear to be neither%
- }
- \fi
-\else
- \if at ip@nix@\else
- \ifshellescape
- \ip at backupplan
- \else
- \ip at cantdecide
+ }
+ \ifwindows
+ \if at ip@nix@
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ I can't tell if this is Windows or *nix;
+ you appear to be neither%
+ }
\fi
+ \else
+ \if at ip@nix@\else
+ \ifshellescape
+ \ip at backupplan
+ \else
+ \ip at cantdecide
+ \fi
+ \fi
\fi
\fi
-\fi
\def\ip at only@six#1#2#3#4#5#6#7\@nil{#1#2#3#4#5#6}
-\if at ip@nix@
-\ifshellescape
+\if at ip@nix@\ifshellescape
\ifwindows\else
- \immediate\write18{uname -s > "\ip at file"}
+ \ShellEscape{uname -s > "\ip at file"}
\CatchFileDef\@tempa{\ip at file}{}
- \immediate\write18{rm -- "\ip at file"}
+ \ShellEscape{rm -- "\ip at file"}
\edef\@tempa{\expandafter\zap at space\@tempa\@empty}
\def\@tempb{Linux}
\ifx\@tempa\@tempb
@@ -135,7 +134,7 @@
\fi
\fi
}
-%% Copyright (C) 2007-2010 by Will Robertson & Johannes Gro^^c3^^9fe
+%% Copyright (C) 2007-2017 by Will Robertson & Johannes Gro^^c3^^9fe
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
More information about the tex-live-commits
mailing list