diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-09 22:40:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-09 22:40:45 +0000 |
commit | 06dc2ac0c58e7afd9bf81aefca0a466f5c026c91 (patch) | |
tree | 27bc27c9dd2f86189e69a78b5b2a7d3331724142 /Master/texmf-dist/source/support/texosquery | |
parent | 362b2fc01b04915a3706a78c8d7072a2c4265707 (diff) |
texosquery
git-svn-id: svn://tug.org/texlive/trunk@43725 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/support/texosquery')
6 files changed, 54 insertions, 20 deletions
diff --git a/Master/texmf-dist/source/support/texosquery/java/TeXOSQuery.java b/Master/texmf-dist/source/support/texosquery/java/TeXOSQuery.java index aad5a50a790..cf1f59d12bf 100644 --- a/Master/texmf-dist/source/support/texosquery/java/TeXOSQuery.java +++ b/Master/texmf-dist/source/support/texosquery/java/TeXOSQuery.java @@ -280,6 +280,15 @@ public class TeXOSQuery implements Serializable } /** + * Fallback for openin_any if not found. + * @since 1.2.2 + */ + public char openinFallbackValue() + { + return OPENIN_A; + } + + /** * Queries if the given file may be read according to * openin_any. Since the user may not require any of the file * access functions, the openin variable is only set the first @@ -287,7 +296,9 @@ public class TeXOSQuery implements Serializable * kpsewhich is used to lookup the value of openin_any, which * may have one of the following values: a (any), r (restricted, * no hidden files) or p (paranoid, as restricted and no parent - * directories and no absolute paths except under $TEXMFOUTPUT) + * directories and no absolute paths except under $TEXMFOUTPUT). + * Apparently with MikTeX, this variable isn't available, so we + * need a fallback for that case. * @param file The file to be checked * @return true if read-access allowed * @since 1.2 @@ -325,10 +336,12 @@ public class TeXOSQuery implements Serializable } else { - // This shouldn't occur, but just in case... - debug(String.format("Invalid openin_any value: %s", - result)); - openin = OPENIN_P; + // openin_any variable hasn't been set, use the + // fallback value. + openin = openinFallbackValue(); + debug(String.format( + "Invalid openin_any value: %s%nUsing fallback value: %s", + result, openin)); } } catch (Exception e) @@ -4299,8 +4312,8 @@ public class TeXOSQuery implements Serializable public static final int DEFAULT_COMPATIBLE=2; - private static final String VERSION_NUMBER = "1.2.1"; - private static final String VERSION_DATE = "2017-03-28"; + private static final String VERSION_NUMBER = "1.3"; + private static final String VERSION_DATE = "2017-03-31"; private static final char BACKSLASH = '\\'; private static final long ZERO = 0L; @@ -4313,10 +4326,10 @@ public class TeXOSQuery implements Serializable /** * openin_any settings */ - private static final char OPENIN_UNSET=0; // unset - private static final char OPENIN_A='a'; // any - private static final char OPENIN_R='r'; // restricted - private static final char OPENIN_P='p'; // paranoid + protected static final char OPENIN_UNSET=0; // unset + protected static final char OPENIN_A='a'; // any + protected static final char OPENIN_R='r'; // restricted + protected static final char OPENIN_P='p'; // paranoid private char openin = OPENIN_UNSET; diff --git a/Master/texmf-dist/source/support/texosquery/java/TeXOSQueryJRE8.java b/Master/texmf-dist/source/support/texosquery/java/TeXOSQueryJRE8.java index ab65d64bbf5..02b28fe726f 100644 --- a/Master/texmf-dist/source/support/texosquery/java/TeXOSQueryJRE8.java +++ b/Master/texmf-dist/source/support/texosquery/java/TeXOSQueryJRE8.java @@ -33,6 +33,16 @@ public class TeXOSQueryJRE8 extends TeXOSQuery super("texosquery-jre8"); } + /** + * Fallback for openin_any if not found. + * @since 1.2.2 + * @Override + */ + public char openinFallbackValue() + { + return OPENIN_P; + } + /** * Converts the given directory to a canonical path * and checks to make sure it has a parent directory. diff --git a/Master/texmf-dist/source/support/texosquery/texosquery-jre5.batch b/Master/texmf-dist/source/support/texosquery/texosquery-jre5.batch index 3b307fb85b0..9202bbf8746 100644 --- a/Master/texmf-dist/source/support/texosquery/texosquery-jre5.batch +++ b/Master/texmf-dist/source/support/texosquery/texosquery-jre5.batch @@ -1,4 +1,4 @@ @ECHO OFF -FOR /F %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar') DO SET JARPATH=%%I +FOR /F "tokens=*" %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar') DO SET JARPATH=%%I java -jar "%JARPATH%" %* diff --git a/Master/texmf-dist/source/support/texosquery/texosquery-jre8.batch b/Master/texmf-dist/source/support/texosquery/texosquery-jre8.batch index 6e8d1547df7..050a50eb600 100644 --- a/Master/texmf-dist/source/support/texosquery/texosquery-jre8.batch +++ b/Master/texmf-dist/source/support/texosquery/texosquery-jre8.batch @@ -1,4 +1,4 @@ @ECHO OFF -FOR /F %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar') DO SET JARPATH=%%I +FOR /F "tokens=*" %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar') DO SET JARPATH=%%I java -Djava.locale.providers=CLDR,JRE -jar "%JARPATH%" %* diff --git a/Master/texmf-dist/source/support/texosquery/texosquery.batch b/Master/texmf-dist/source/support/texosquery/texosquery.batch index 2ac1b43cda2..41b7d00bc0b 100644 --- a/Master/texmf-dist/source/support/texosquery/texosquery.batch +++ b/Master/texmf-dist/source/support/texosquery/texosquery.batch @@ -1,4 +1,4 @@ @ECHO OFF -FOR /F %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar') DO SET JARPATH=%%I +FOR /F "tokens=*" %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar') DO SET JARPATH=%%I java -jar "%JARPATH%" %* diff --git a/Master/texmf-dist/source/support/texosquery/texosquery.dtx b/Master/texmf-dist/source/support/texosquery/texosquery.dtx index 16dca119d00..7f0e3742dfc 100644 --- a/Master/texmf-dist/source/support/texosquery/texosquery.dtx +++ b/Master/texmf-dist/source/support/texosquery/texosquery.dtx @@ -123,7 +123,7 @@ Organization for Standardization} %\author{Nicola L. C. Talbot\\ %\href{http://www.dickimaw-books.com/}{\nolinkurl{dickimaw-books.com}} %\and Paulo Cereda} -%\date{2017-03-28 (v1.2.1)} +%\date{2017-03-31 (v1.3)} %\maketitle % %\begin{abstract} @@ -595,6 +595,17 @@ Organization for Standardization} %absolute path that isn't under \texttt{\$TEXMFOUTPUT} (assuming %that environment variable hasn't been set to \file{/tmp}). % +%\subsection{MikTeX} +%Apparently MikTeX doesn't support the \texttt{openin\_any} +%variable, so if this is unset, \file{texosquery.jar} and +%\file{texosquery-jre5.jar} will fallback on \qt{\texttt{a}}, but +%the stricter \file{texosquery-jre8.jar} will fallback on +%\qt{\texttt{p}}. +% +%Note that MiKTeX disables piped input by default for security +%reasons. Since \cs{TeXOSQuery} relies on piped input, you'll need +%to enable it with \texttt{-{}-enable-pipes} when you run \TeX. +% %\subsection{Return Values} %\label{sec:returnvalues} %The return values may include literal text where special characters @@ -2582,7 +2593,7 @@ Organization for Standardization} % \end{macrocode} % Version info. % \begin{macrocode} -\expandafter\def\csname ver@texosquery.tex\endcsname{2017/03/28 v1.2.1 (NLCT)} +\expandafter\def\csname ver@texosquery.tex\endcsname{2017/03/31 v1.3 (NLCT)} % \end{macrocode} % %\begin{macro}{\@texosquery@warn} @@ -7565,7 +7576,7 @@ Organization for Standardization} %Identify package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{texosquery}[2017/03/28 v1.2.1 (NLCT)] +\ProvidesPackage{texosquery}[2017/03/31 v1.3 (NLCT)] % \end{macrocode} %Load \file{texosquery.tex}: % \begin{macrocode} @@ -7677,7 +7688,7 @@ java -jar "$jarpath" "$@" %\subsubsection{\file{texosquery.bat}} % \begin{macrocode} @ECHO OFF -FOR /F %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar') DO SET JARPATH=%%I +FOR /F "tokens=*" %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar') DO SET JARPATH=%%I java -jar "%JARPATH%" %* % \end{macrocode} %\iffalse @@ -7694,7 +7705,7 @@ java -jar "%JARPATH%" %* %\subsubsection{\file{texosquery-jre8.bat}} % \begin{macrocode} @ECHO OFF -FOR /F %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar') DO SET JARPATH=%%I +FOR /F "tokens=*" %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar') DO SET JARPATH=%%I java -Djava.locale.providers=CLDR,JRE -jar "%JARPATH%" %* % \end{macrocode} %\iffalse @@ -7711,7 +7722,7 @@ java -Djava.locale.providers=CLDR,JRE -jar "%JARPATH%" %* %\subsubsection{\file{texosquery-jre5.bat}} % \begin{macrocode} @ECHO OFF -FOR /F %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar') DO SET JARPATH=%%I +FOR /F "tokens=*" %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar') DO SET JARPATH=%%I java -jar "%JARPATH%" %* % \end{macrocode} %\iffalse |