summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ifplatform
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-01-24 00:28:42 +0000
committerKarl Berry <karl@freefriends.org>2011-01-24 00:28:42 +0000
commit2344cb8ba621f8c56a134c1abd7e9b90efba6345 (patch)
treea3abb7b0b1799fb04ae9dd90e7d93e34e282e92f /Master/texmf-dist/tex/latex/ifplatform
parent1a7766f8eaec99aa55f9a73e855b0596935fd3a5 (diff)
ifplatform (24jan11)
git-svn-id: svn://tug.org/texlive/trunk@21156 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ifplatform')
-rw-r--r--Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty22
1 files changed, 17 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty b/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty
index cd7cfe51318..31840ce8e80 100644
--- a/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty
+++ b/Master/texmf-dist/tex/latex/ifplatform/ifplatform.sty
@@ -5,12 +5,12 @@
%% The original source files were:
%%
%% ifplatform.dtx (with options: `package')
-%% _________________________________________________________
-%% Copyright (C) 2007, 2009 Will Robertson & Johannes Große
+%% ________________________________________________________
+%% Copyright (C) 2007-2010 Will Robertson & Johannes Gro^^c3^^9fe
%% License information appended.
\ProvidesPackage{ifplatform}
- [2009/09/10 v0.3a Testing for the operating system]
-\RequirePackage{pdftexcmds,catchfile}
+ [2010/10/22 v0.4 Testing for the operating system]
+\RequirePackage{pdftexcmds,catchfile,ifluatex}
\newif\ifshellescape
\newif\ifwindows
\newif\ifmacosx
@@ -27,10 +27,12 @@
\ifnum\pdf@shellescape=1\relax
\shellescapetrue
\else
+ \ifluatex\else
\PackageWarningNoLine{ifplatform}{^^J \space\space\space
shell escape is disabled,
so I can only detect \@backslashchar ifwindows%
}
+ \fi
\fi
\def\ip@cantdecide{%
\PackageWarningNoLine{ifplatform}{^^J \space\space\space
@@ -38,6 +40,15 @@
you appear to be both%
}%
}
+\ifluatex
+ \csname\directlua{
+ if os.type == "unix" then
+ tex.sprint("@ip@nix@true")
+ elseif os.type == "windows" then
+ tex.sprint("windowstrue")
+ 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"}
@@ -73,6 +84,7 @@
\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
@@ -123,7 +135,7 @@
\fi
\fi
}
-%% Copyright (C) 2007, 2009 by Will Robertson & Johannes Große
+%% Copyright (C) 2007-2010 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