summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/support/texosquery/texosquery.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/support/texosquery/texosquery.dtx')
-rw-r--r--Master/texmf-dist/source/support/texosquery/texosquery.dtx166
1 files changed, 133 insertions, 33 deletions
diff --git a/Master/texmf-dist/source/support/texosquery/texosquery.dtx b/Master/texmf-dist/source/support/texosquery/texosquery.dtx
index b3ec60201a0..d85b92ad1dd 100644
--- a/Master/texmf-dist/source/support/texosquery/texosquery.dtx
+++ b/Master/texmf-dist/source/support/texosquery/texosquery.dtx
@@ -81,6 +81,8 @@
\newcommand*{\longarg}[1]{\longargfmt{#1}%
\index{texosquery options=\app{texosquery} options>#1=\protect\longargfmt{#1}|hyperpage}}
+\newcommand*{\Index}[1]{#1\index{#1|hyperpage}}
+
\newenvironment{important}
{\begin{quote}\textbf{Important Note:}}
{\end{quote}}
@@ -125,7 +127,7 @@ Organization for Standardization}
%\author{Nicola L. C. Talbot\\
%\href{http://www.dickimaw-books.com/}{\nolinkurl{dickimaw-books.com}}
%\and Paulo Cereda}
-%\date{2017-05-05 (v1.4)}
+%\date{2017-05-23 (v1.5)}
%\maketitle
%
%\begin{abstract}
@@ -646,6 +648,21 @@ Organization for Standardization}
%For the full list of shortcut commands, see the
%definition of \hyperlink{enableshortcs}{\cs{@texosquery@enableshortcs}}.
%
+%If the operating system uses a backslash \verb|\| as a directory
+%divider, returned path names will always replace this with a
+%forward slash \verb|/| (which is then converted to \cs{fslh}, as
+%described above). This is designed to make the result as compatible
+%as possible with \TeX\ file commands (such as \cs{input}) which
+%require a forward slash. However, for some systems,
+%further modification may need to be done. For example, with \TeX\
+%on \Index{Cygwin}, the Windows path name
+%\verb|c:\cygwin64\usr\local\texlive| may correspond to the \TeX\ path
+%name \file{/usr/local/texlive}. This path is returned by
+%\app{texosquery} as \file{c:/cygwin64/usr/local/texlive} (\cs{fcln} and
+%\cs{fslh} replaced for clarity). You can use
+%\longargfmt{strip-path-prefix} to strip the leading
+%\file{c:/cygwin64} for convenience (see section~\ref{sec:invocation}).
+%
%The output produced by the \app{texosquery} application
%will be returned using the system's default input
%encoding. (For example, \gls{UTF}-8.) You will need to ensure that your \TeX\
@@ -739,7 +756,7 @@ Organization for Standardization}
%provided by Java. For example, Java currently doesn't
%provide any methods to access telephone codes.
%
-%\subsection{Command line invocation}
+%\subsection{Command line invocation}\label{sec:invocation}
%The syntax for the command line invocation of \app{texosquery}
%is:
%\begin{definition}
@@ -760,10 +777,13 @@ Organization for Standardization}
%\begin{description}
%\item[\shortarg{h} or \longarg{help} or \shortarg{help}] Displays help message and
%exits.
+%
%\item[\shortarg{v} or \longarg{version} or \shortarg{version}] Displays version
%information and exits.
+%
%\item[\longarg{nodebug}] No debugging information. Only command
%line syntax errors are written to STDERR. (Default.)
+%
%\item[\longarg{debug} \oarg{n} or \shortarg{debug} \oarg{n}] Set the debugging level, where
%\meta{n} is a non-negative integer.
%If \meta{n} is omitted, 3 is assumed. If \meta{n} is 0, then
@@ -772,10 +792,11 @@ Organization for Standardization}
%written to STDERR. If \meta{n} $\geq 2$, any exceptions encountered
%will additionally write the stack trace to STDERR. If \meta{n}
%$\geq 3$ non-error informational messages are included.
+%
%\item[\longarg{compatible} \meta{n} or \shortarg{compat} \meta{n}]
%Set the compatibility mode.
%The argument should be either a non-negative integer (0 for version
-%1.0, 1 for version 1.1, etc) or the keyword \texttt{latest} to
+%1.0, 1 for version 1.1, 2 for version 1.2 onwards) or the keyword \texttt{latest} to
%indicate the latest version (default). Note that the compatibility
%mode only affects the available actions and the display style of the
%result, and does not change security features. For example, the check for the
@@ -783,6 +804,65 @@ Organization for Standardization}
%is still checked even if the compatibility mode is set to 0 or 1.
%\end{description}
%
+%The following options (introduced in v1.5) allow returned paths or URIs
+%to be altered (for example, if a mount point needs to be removed).
+%Note that these options only affect \emph{returned} paths, not
+%path names provided in the command line. The substitution is
+%performed after any backslash directory dividers
+%\verb|\| are changed to forward slashes \texttt{/} (if applicable) but before
+%non-alphanumerics are changed to control sequences (such as
+%\cs{fcln} or \cs{fslh}). If there's no match, the path is returned
+%without alteration.
+%
+%\begin{description}
+%\item[\longarg{strip-path-prefix} \meta{prefix} or \shortarg{sp}
+%\meta{prefix}]
+%Strip \meta{prefix} from the start of returned path names (but
+%not URIs, see below). For example:
+%\begin{verbatim}
+%texosquery --strip-path-prefix c:/cygwin64 -p article.cls
+%\end{verbatim}
+%This will strip the \texttt{c:/cygwin64} mount point. Note that
+%\meta{prefix} isn't an expression. For a regular expression, use
+%\longarg{replace-path}. (This option can't be
+%used with \longarg{replace-path}.)
+%
+%\item[\longarg{nostrip-path-prefix}]
+%Cancels the effect of \longarg{strip-path-prefix}.
+%
+%\item[\longarg{replace-path} \meta{regex} \meta{replacement}
+%or \shortarg{rp} \meta{regex} \meta{replacement}]
+%This replaces the \emph{first} occurrence of the regular
+%expression \meta{regex} in any returned path (but not URI) and replaces it with
+%\meta{replacement}.
+%
+%\item[\longarg{noreplace-path}]
+%Cancels the effect of the \longarg{replace-path}.
+%
+%\item[\longarg{strip-uri-prefix} \meta{prefix} or \shortarg{su}
+%\meta{prefix}]
+%Replace initial \texttt{file:/}\meta{prefix} with just
+%\texttt{file:/} from returned URIs. Note that
+%\meta{prefix} isn't an expression. For a regular expression, use
+%\longarg{replace-uri}. (This option can't be
+%used with \longarg{replace-uri}.)
+%
+%\item[\longarg{nostrip-uri-prefix}]
+%Cancels the effect of \longarg{strip-uri-prefix}.
+%
+%\item[\longarg{replace-uri} \meta{regex} \meta{replacement}
+%or \shortarg{ru} \meta{regex} \meta{replacement}]
+%This replaces the \emph{first} occurrence of the regular
+%expression \meta{regex} in any returned URI and replaces it with
+%\meta{replacement}. For example:
+%\begin{verbatim}
+%texosquery -ru file:/C: file://cgwin64/c -u filename
+%\end{verbatim}
+%
+%\item[\longarg{noreplace-uri}]
+%Cancels the effect of the \longarg{replace-uri}.
+%\end{description}
+%
%If multiple actions are given, they will be processed in the
%order specified in the command line invocation. Each result will
%be displayed on a separate line. As from v1.1, if there are
@@ -2547,7 +2627,7 @@ Organization for Standardization}
% \end{macrocode}
% Version info.
% \begin{macrocode}
-\expandafter\def\csname ver@texosquery.tex\endcsname{2017/05/05 v1.4 (NLCT)}
+\expandafter\def\csname ver@texosquery.tex\endcsname{2017/05/23 v1.5 (NLCT)}
% \end{macrocode}
%
%\begin{macro}{\@texosquery@warn}
@@ -7825,7 +7905,7 @@ Organization for Standardization}
%Identify package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{texosquery}[2017/05/05 v1.4 (NLCT)]
+\ProvidesPackage{texosquery}[2017/05/23 v1.5 (NLCT)]
% \end{macrocode}
%Load \file{texosquery.tex}:
% \begin{macrocode}
@@ -7846,37 +7926,38 @@ Organization for Standardization}
% \end{macrocode}
%\fi
% \begin{macrocode}
- % This configuration file must be edited to match your system.
- % Copy the file to your TEXMFLOCAL or TEXMFHOME tree to prevent it
- % from being overwritten by updates.
-
- % 1. Check your version of Java. To do this run
- % java -version
- % from your command line.
+%<<COMMENT
+% This configuration file must be edited to match your system.
+% Copy the file to your TEXMFLOCAL or TEXMFHOME tree to prevent it
+% from being overwritten by updates.
- % * If the version number starts with "1.5" or "1.6" then
- % \TeXOSInvokerName must be texosquery-jre5
- %
- % * If the version number starts with "1.7" then
- % \TeXOSInvokerName must be texosquery
- %
- % * If the version number starts with "1.8" then
- % \TeXOSInvokerName must be texosquery-jre8
+% 1. Check your version of Java. To do this run
+% java -version
+% from your command line.
- % (bash users need to check that the .sh extension has been removed
- % from the bash scripts.)
+% * If the version number starts with "1.5" or "1.6" then
+% \TeXOSInvokerName must be texosquery-jre5
+%
+% * If the version number starts with "1.7" then
+% \TeXOSInvokerName must be texosquery
+%
+% * If the version number starts with "1.8" then
+% \TeXOSInvokerName must be texosquery-jre8
- \def\TeXOSInvokerName{texosquery}
+% (bash users need to check that the .sh extension has been removed
+% from the bash scripts.)
- % 2. If the invoker name given in the definition above is on the
- % restricted list, uncomment the line below to allow it to be run
- % in restricted mode:
+\def\TeXOSInvokerName{texosquery}
- %\TeXOSQueryAllowRestricted
+% 2. If the invoker name given in the definition above is on the
+% restricted list, uncomment the line below to allow it to be run
+% in restricted mode:
- % Leave it commented out if the invoker name is not on the
- % restricted list.
+%\TeXOSQueryAllowRestricted
+% Leave it commented out if the invoker name is not on the
+% restricted list.
+%COMMENT
% \end{macrocode}
%\iffalse
% \begin{macrocode}
@@ -7898,9 +7979,16 @@ Organization for Standardization}
% \end{macrocode}
%\fi
%\subsubsection{\file{texosquery.sh}}
+%This now has a check for cygwin.
% \begin{macrocode}
-jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar`
-java -jar "$jarpath" "$@"
+kernel=`uname -s`
+if test "${kernel#*CYGWIN}" != "$kernel"
+then
+ jarpath=`cygpath -w $(kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar)`
+else
+ jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar`
+fi
+java -jar "$jarpath" "$@"
% \end{macrocode}
%\iffalse
% \begin{macrocode}
@@ -7915,7 +8003,13 @@ java -jar "$jarpath" "$@"
%\fi
%\subsubsection{\file{texosquery-jre8.sh}}
% \begin{macrocode}
-jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar`
+kernel=`uname -s`
+if test "${kernel#*CYGWIN}" != "$kernel"
+then
+ jarpath=`cygpath -w $(kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar)`
+else
+ jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar`
+fi
java -Djava.locale.providers=CLDR,JRE -jar "$jarpath" "$@"
% \end{macrocode}
%\iffalse
@@ -7931,7 +8025,13 @@ java -Djava.locale.providers=CLDR,JRE -jar "$jarpath" "$@"
%\fi
%\subsubsection{\file{texosquery-jre5.sh}}
% \begin{macrocode}
-jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar`
+kernel=`uname -s`
+if test "${kernel#*CYGWIN}" != "$kernel"
+then
+ jarpath=`cygpath -w $(kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar)`
+else
+ jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar`
+fi
java -jar "$jarpath" "$@"
% \end{macrocode}
%\iffalse