diff options
author | Karl Berry <karl@freefriends.org> | 2017-10-13 21:40:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-10-13 21:40:26 +0000 |
commit | c97f4fb8eda9e467d7694621cc5916d75acef5c7 (patch) | |
tree | 74e9ccc100096450d1db6d46ce3fd7a209430787 /Master/texmf-dist/tex/latex/ifplatform | |
parent | 8b02c12ef1888a8819a0e33ba7449a522a87afba (diff) |
ifplatform (13oct17)
git-svn-id: svn://tug.org/texlive/trunk@45533 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ifplatform')
-rw-r--r-- | Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty | 83 |
1 files changed, 41 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty b/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty index 31840ce8e80..8d48229e717 100644 --- a/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty +++ b/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty @@ -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@cantdecide{% @@ -49,49 +49,48 @@ end }\endcsname \else -\IfFileExists{nul:}{\@ip@nix@false}{\@ip@nix@true} -\IfFileExists{/dev/null}{\windowsfalse}{\windowstrue} -\edef\ip@windows@echo@test{echo \string# > "\ip@file"} -\def\ip@backupplan{% - \IfFileExists{\ip@file}{% - \PackageWarningNoLine{ifplatform}{^^J \space\space\space - Please delete the file "\ip@file" and try again% - }% - \ip@cantdecide - }{% - \immediate\write18{\ip@windows@echo@test}% + \IfFileExists{nul:}{\@ip@nix@false}{\@ip@nix@true} + \IfFileExists{/dev/null}{\windowsfalse}{\windowstrue} + \edef\ip@windows@echo@test{echo \string# > "\ip@file"} + \def\ip@backupplan{% \IfFileExists{\ip@file}{% - \immediate\write18{del "\ip@file"}% - \windowstrue + \PackageWarningNoLine{ifplatform}{^^J \space\space\space + Please delete the file "\ip@file" and try again% + }% + \ip@cantdecide }{% - \@ip@nix@true + \ShellEscape{\ip@windows@echo@test}% + \IfFileExists{\ip@file}{% + \ShellEscape{del "\ip@file"}% + \windowstrue + }{% + \@ip@nix@true + }% }% - }% -} -\ifwindows - \if@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@ip@nix@\else - \ifshellescape - \ip@backupplan - \else - \ip@cantdecide + } + \ifwindows + \if@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@ip@nix@\else + \ifshellescape + \ip@backupplan + \else + \ip@cantdecide + \fi \fi \fi \fi -\fi \def\ip@only@six#1#2#3#4#5#6#7\@nil{#1#2#3#4#5#6} -\if@ip@nix@ -\ifshellescape +\if@ip@nix@\ifshellescape \ifwindows\else - \immediate\write18{uname -s > "\ip@file"} + \ShellEscape{uname -s > "\ip@file"} \CatchFileDef\@tempa{\ip@file}{} - \immediate\write18{rm -- "\ip@file"} + \ShellEscape{rm -- "\ip@file"} \edef\@tempa{\expandafter\zap@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 |