From 2344cb8ba621f8c56a134c1abd7e9b90efba6345 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 24 Jan 2011 00:28:42 +0000 Subject: ifplatform (24jan11) git-svn-id: svn://tug.org/texlive/trunk@21156 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/ifplatform/ifplatform.sty | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/tex/latex/ifplatform') 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 -- cgit v1.2.3