From 06dc2ac0c58e7afd9bf81aefca0a466f5c026c91 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 Apr 2017 22:40:45 +0000 Subject: texosquery git-svn-id: svn://tug.org/texlive/trunk@43725 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/support/texosquery/CHANGES | 10 ++++++ .../doc/support/texosquery/texosquery.pdf | Bin 489655 -> 490471 bytes .../scripts/texosquery/texosquery-jre5.jar | Bin 62861 -> 62917 bytes .../scripts/texosquery/texosquery-jre8.jar | Bin 67163 -> 67247 bytes .../texmf-dist/scripts/texosquery/texosquery.jar | Bin 66146 -> 66196 bytes .../source/support/texosquery/java/TeXOSQuery.java | 35 ++++++++++++++------- .../support/texosquery/java/TeXOSQueryJRE8.java | 10 ++++++ .../support/texosquery/texosquery-jre5.batch | 2 +- .../support/texosquery/texosquery-jre8.batch | 2 +- .../source/support/texosquery/texosquery.batch | 2 +- .../source/support/texosquery/texosquery.dtx | 23 ++++++++++---- .../texmf-dist/tex/latex/texosquery/texosquery.sty | 2 +- .../texmf-dist/tex/latex/texosquery/texosquery.tex | 2 +- 13 files changed, 66 insertions(+), 22 deletions(-) diff --git a/Master/texmf-dist/doc/support/texosquery/CHANGES b/Master/texmf-dist/doc/support/texosquery/CHANGES index 4cc0c383bce..eae2c455b22 100644 --- a/Master/texmf-dist/doc/support/texosquery/CHANGES +++ b/Master/texmf-dist/doc/support/texosquery/CHANGES @@ -1,3 +1,13 @@ +1.3 (2017/03/31): + + * If 'openin_any' hasn't been set, the fallback value for + texosquery.jar and texosquery-jre5.jar is now 'a' + (instead of 'p'). Fallback value for texosquery-jre8.jar + is still 'p'. + + * Fixed spaces in path issue for the Windows .bat files. + (https://github.com/nlct/texosquery/issues/2) + 1.2.1 (2017/03/28): * Minor bug fix in texosquery.tex (fixed decimal separator diff --git a/Master/texmf-dist/doc/support/texosquery/texosquery.pdf b/Master/texmf-dist/doc/support/texosquery/texosquery.pdf index f11511e67ee..7cb09b482af 100644 Binary files a/Master/texmf-dist/doc/support/texosquery/texosquery.pdf and b/Master/texmf-dist/doc/support/texosquery/texosquery.pdf differ diff --git a/Master/texmf-dist/scripts/texosquery/texosquery-jre5.jar b/Master/texmf-dist/scripts/texosquery/texosquery-jre5.jar index 8c2cacc0d66..cddc5b057ac 100755 Binary files a/Master/texmf-dist/scripts/texosquery/texosquery-jre5.jar and b/Master/texmf-dist/scripts/texosquery/texosquery-jre5.jar differ diff --git a/Master/texmf-dist/scripts/texosquery/texosquery-jre8.jar b/Master/texmf-dist/scripts/texosquery/texosquery-jre8.jar index a8f91be6884..3693b345148 100755 Binary files a/Master/texmf-dist/scripts/texosquery/texosquery-jre8.jar and b/Master/texmf-dist/scripts/texosquery/texosquery-jre8.jar differ diff --git a/Master/texmf-dist/scripts/texosquery/texosquery.jar b/Master/texmf-dist/scripts/texosquery/texosquery.jar index 44f54fa4337..667cc7cf8fc 100755 Binary files a/Master/texmf-dist/scripts/texosquery/texosquery.jar and b/Master/texmf-dist/scripts/texosquery/texosquery.jar differ 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 @@ -279,6 +279,15 @@ public class TeXOSQuery implements Serializable return true; } + /** + * 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 @@ -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 diff --git a/Master/texmf-dist/tex/latex/texosquery/texosquery.sty b/Master/texmf-dist/tex/latex/texosquery/texosquery.sty index 95aeff3b3d0..7f7174f48ae 100644 --- a/Master/texmf-dist/tex/latex/texosquery/texosquery.sty +++ b/Master/texmf-dist/tex/latex/texosquery/texosquery.sty @@ -43,7 +43,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{texosquery}[2017/03/28 v1.2.1 (NLCT)] +\ProvidesPackage{texosquery}[2017/03/31 v1.3 (NLCT)] \input{texosquery} \endinput %% diff --git a/Master/texmf-dist/tex/latex/texosquery/texosquery.tex b/Master/texmf-dist/tex/latex/texosquery/texosquery.tex index 9bc4aad662a..d004f4503c2 100644 --- a/Master/texmf-dist/tex/latex/texosquery/texosquery.tex +++ b/Master/texmf-dist/tex/latex/texosquery/texosquery.tex @@ -54,7 +54,7 @@ \@texosquery@restore@at \expandafter\endinput \fi -\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)} \ifx\@tracklang@pkgwarn\undefined \ifx\PackageWarning\undefined \def\@texosquery@warn#1{% -- cgit v1.2.3