From 290d4ccb69531961a454b334f0ede186ebe88396 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 24 Mar 2017 22:42:34 +0000 Subject: texosquery (24mar17) git-svn-id: svn://tug.org/texlive/trunk@43596 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/texk/texlive/linked_scripts/Makefile.am | 4 +- .../source/texk/texlive/linked_scripts/Makefile.in | 4 +- .../source/texk/texlive/linked_scripts/scripts.lst | 4 +- .../linked_scripts/texosquery/texosquery-jre5.sh | 4 + .../linked_scripts/texosquery/texosquery-jre8.sh | 4 + .../linked_scripts/texosquery/texosquery.sh | 4 + Master/bin/amd64-freebsd/texosquery | 2 +- Master/bin/amd64-freebsd/texosquery-jre5 | 1 + Master/bin/amd64-freebsd/texosquery-jre8 | 1 + Master/bin/amd64-netbsd/texosquery | 2 +- Master/bin/amd64-netbsd/texosquery-jre5 | 1 + Master/bin/amd64-netbsd/texosquery-jre8 | 1 + Master/bin/armel-linux/texosquery | 2 +- Master/bin/armel-linux/texosquery-jre5 | 1 + Master/bin/armel-linux/texosquery-jre8 | 1 + Master/bin/armhf-linux/texosquery | 2 +- Master/bin/armhf-linux/texosquery-jre5 | 1 + Master/bin/armhf-linux/texosquery-jre8 | 1 + Master/bin/i386-cygwin/texosquery | 2 +- Master/bin/i386-cygwin/texosquery-jre5 | 1 + Master/bin/i386-cygwin/texosquery-jre8 | 1 + Master/bin/i386-freebsd/texosquery | 2 +- Master/bin/i386-freebsd/texosquery-jre5 | 1 + Master/bin/i386-freebsd/texosquery-jre8 | 1 + Master/bin/i386-linux/texosquery | 2 +- Master/bin/i386-linux/texosquery-jre5 | 1 + Master/bin/i386-linux/texosquery-jre8 | 1 + Master/bin/i386-netbsd/texosquery | 2 +- Master/bin/i386-netbsd/texosquery-jre5 | 1 + Master/bin/i386-netbsd/texosquery-jre8 | 1 + Master/bin/i386-solaris/texosquery | 2 +- Master/bin/i386-solaris/texosquery-jre5 | 1 + Master/bin/i386-solaris/texosquery-jre8 | 1 + Master/bin/powerpc-linux/texosquery | 2 +- Master/bin/powerpc-linux/texosquery-jre5 | 1 + Master/bin/powerpc-linux/texosquery-jre8 | 1 + Master/bin/sparc-solaris/texosquery | 2 +- Master/bin/sparc-solaris/texosquery-jre5 | 1 + Master/bin/sparc-solaris/texosquery-jre8 | 1 + Master/bin/universal-darwin/texosquery | 2 +- Master/bin/universal-darwin/texosquery-jre5 | 1 + Master/bin/universal-darwin/texosquery-jre8 | 1 + Master/bin/win32/texosquery.exe | Bin 1536 -> 0 bytes Master/bin/x86_64-cygwin/texosquery | 2 +- Master/bin/x86_64-cygwin/texosquery-jre5 | 1 + Master/bin/x86_64-cygwin/texosquery-jre8 | 1 + Master/bin/x86_64-darwin/texosquery | 2 +- Master/bin/x86_64-darwin/texosquery-jre5 | 1 + Master/bin/x86_64-darwin/texosquery-jre8 | 1 + Master/bin/x86_64-linux/texosquery | 2 +- Master/bin/x86_64-linux/texosquery-jre5 | 1 + Master/bin/x86_64-linux/texosquery-jre8 | 1 + Master/bin/x86_64-solaris/texosquery | 2 +- Master/bin/x86_64-solaris/texosquery-jre5 | 1 + Master/bin/x86_64-solaris/texosquery-jre8 | 1 + Master/texmf-dist/doc/support/texosquery/CHANGES | 106 + .../texmf-dist/doc/support/texosquery/Manifest.txt | 2 - Master/texmf-dist/doc/support/texosquery/README.md | 233 +- .../doc/support/texosquery/texosquery.pdf | Bin 251370 -> 488948 bytes Master/texmf-dist/scripts/texosquery/texosquery | 4 - .../scripts/texosquery/texosquery-jre5.jar | Bin 0 -> 62861 bytes .../scripts/texosquery/texosquery-jre5.sh | 4 + .../scripts/texosquery/texosquery-jre8.jar | Bin 0 -> 67162 bytes .../scripts/texosquery/texosquery-jre8.sh | 4 + .../texmf-dist/scripts/texosquery/texosquery.jar | Bin 6773 -> 66145 bytes Master/texmf-dist/scripts/texosquery/texosquery.sh | 4 + .../source/support/texosquery/TeXOSQuery.java | 767 -- .../support/texosquery/java/FileListType.java | 24 + .../texosquery/java/FilePathSortComparator.java | 186 + .../texosquery/java/FileSortComparator.java | 170 + .../support/texosquery/java/FileSortType.java | 131 + .../support/texosquery/java/FileWalkVisitor.java | 221 + .../support/texosquery/java/Manifest-jre5.txt | 2 + .../support/texosquery/java/Manifest-jre7.txt | 2 + .../support/texosquery/java/Manifest-jre8.txt | 2 + .../support/texosquery/java/QueryAction.java | 448 ++ .../support/texosquery/java/QueryActionType.java | 19 + .../source/support/texosquery/java/TeXOSQuery.java | 4459 +++++++++++ .../support/texosquery/java/TeXOSQueryJRE5.java | 54 + .../support/texosquery/java/TeXOSQueryJRE7.java | 197 + .../support/texosquery/java/TeXOSQueryJRE8.java | 377 + .../support/texosquery/texosquery-jre5.batch | 4 + .../support/texosquery/texosquery-jre8.batch | 4 + .../source/support/texosquery/texosquery.batch | 4 + .../source/support/texosquery/texosquery.dtx | 7949 ++++++++++++++++++-- .../source/support/texosquery/texosquery.ins | 58 +- .../texmf-dist/tex/latex/texosquery/texosquery.cfg | 62 + .../texmf-dist/tex/latex/texosquery/texosquery.sty | 14 +- .../texmf-dist/tex/latex/texosquery/texosquery.tex | 1756 ++++- Master/tlpkg/libexec/ctan2tds | 4 +- Master/tlpkg/tlpsrc/texosquery.tlpsrc | 2 +- 91 files changed, 15940 insertions(+), 1421 deletions(-) create mode 100755 Build/source/texk/texlive/linked_scripts/texosquery/texosquery-jre5.sh create mode 100755 Build/source/texk/texlive/linked_scripts/texosquery/texosquery-jre8.sh create mode 100755 Build/source/texk/texlive/linked_scripts/texosquery/texosquery.sh create mode 120000 Master/bin/amd64-freebsd/texosquery-jre5 create mode 120000 Master/bin/amd64-freebsd/texosquery-jre8 create mode 120000 Master/bin/amd64-netbsd/texosquery-jre5 create mode 120000 Master/bin/amd64-netbsd/texosquery-jre8 create mode 120000 Master/bin/armel-linux/texosquery-jre5 create mode 120000 Master/bin/armel-linux/texosquery-jre8 create mode 120000 Master/bin/armhf-linux/texosquery-jre5 create mode 120000 Master/bin/armhf-linux/texosquery-jre8 create mode 120000 Master/bin/i386-cygwin/texosquery-jre5 create mode 120000 Master/bin/i386-cygwin/texosquery-jre8 create mode 120000 Master/bin/i386-freebsd/texosquery-jre5 create mode 120000 Master/bin/i386-freebsd/texosquery-jre8 create mode 120000 Master/bin/i386-linux/texosquery-jre5 create mode 120000 Master/bin/i386-linux/texosquery-jre8 create mode 120000 Master/bin/i386-netbsd/texosquery-jre5 create mode 120000 Master/bin/i386-netbsd/texosquery-jre8 create mode 120000 Master/bin/i386-solaris/texosquery-jre5 create mode 120000 Master/bin/i386-solaris/texosquery-jre8 create mode 120000 Master/bin/powerpc-linux/texosquery-jre5 create mode 120000 Master/bin/powerpc-linux/texosquery-jre8 create mode 120000 Master/bin/sparc-solaris/texosquery-jre5 create mode 120000 Master/bin/sparc-solaris/texosquery-jre8 create mode 120000 Master/bin/universal-darwin/texosquery-jre5 create mode 120000 Master/bin/universal-darwin/texosquery-jre8 delete mode 100755 Master/bin/win32/texosquery.exe create mode 120000 Master/bin/x86_64-cygwin/texosquery-jre5 create mode 120000 Master/bin/x86_64-cygwin/texosquery-jre8 create mode 120000 Master/bin/x86_64-darwin/texosquery-jre5 create mode 120000 Master/bin/x86_64-darwin/texosquery-jre8 create mode 120000 Master/bin/x86_64-linux/texosquery-jre5 create mode 120000 Master/bin/x86_64-linux/texosquery-jre8 create mode 120000 Master/bin/x86_64-solaris/texosquery-jre5 create mode 120000 Master/bin/x86_64-solaris/texosquery-jre8 delete mode 100644 Master/texmf-dist/doc/support/texosquery/Manifest.txt delete mode 100755 Master/texmf-dist/scripts/texosquery/texosquery create mode 100755 Master/texmf-dist/scripts/texosquery/texosquery-jre5.jar create mode 100755 Master/texmf-dist/scripts/texosquery/texosquery-jre5.sh create mode 100755 Master/texmf-dist/scripts/texosquery/texosquery-jre8.jar create mode 100755 Master/texmf-dist/scripts/texosquery/texosquery-jre8.sh create mode 100755 Master/texmf-dist/scripts/texosquery/texosquery.sh delete mode 100644 Master/texmf-dist/source/support/texosquery/TeXOSQuery.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/FileListType.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/FilePathSortComparator.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/FileSortComparator.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/FileSortType.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/FileWalkVisitor.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/Manifest-jre5.txt create mode 100644 Master/texmf-dist/source/support/texosquery/java/Manifest-jre7.txt create mode 100644 Master/texmf-dist/source/support/texosquery/java/Manifest-jre8.txt create mode 100644 Master/texmf-dist/source/support/texosquery/java/QueryAction.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/QueryActionType.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/TeXOSQuery.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/TeXOSQueryJRE5.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/TeXOSQueryJRE7.java create mode 100644 Master/texmf-dist/source/support/texosquery/java/TeXOSQueryJRE8.java create mode 100644 Master/texmf-dist/source/support/texosquery/texosquery-jre5.batch create mode 100644 Master/texmf-dist/source/support/texosquery/texosquery-jre8.batch create mode 100644 Master/texmf-dist/source/support/texosquery/texosquery.batch create mode 100644 Master/texmf-dist/tex/latex/texosquery/texosquery.cfg diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am index 1d6db0fa415..09c2f3b6896 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.am +++ b/Build/source/texk/texlive/linked_scripts/Makefile.am @@ -79,7 +79,9 @@ texmf_shell_scripts = \ pdfxup/pdfxup \ pst-pdf/ps4pdf \ simpdftex/simpdftex \ - texosquery/texosquery \ + texosquery/texosquery.sh \ + texosquery/texosquery-jre5.sh \ + texosquery/texosquery-jre8.sh \ typeoutfileinfo/typeoutfileinfo.sh texmf_other_scripts = \ a2ping/a2ping.pl \ diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in index 214737306b2..50e0d82452f 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.in +++ b/Build/source/texk/texlive/linked_scripts/Makefile.in @@ -293,7 +293,9 @@ texmf_shell_scripts = \ pdfxup/pdfxup \ pst-pdf/ps4pdf \ simpdftex/simpdftex \ - texosquery/texosquery \ + texosquery/texosquery.sh \ + texosquery/texosquery-jre5.sh \ + texosquery/texosquery-jre8.sh \ typeoutfileinfo/typeoutfileinfo.sh texmf_other_scripts = \ diff --git a/Build/source/texk/texlive/linked_scripts/scripts.lst b/Build/source/texk/texlive/linked_scripts/scripts.lst index c5ce779362c..dd52f5545e1 100644 --- a/Build/source/texk/texlive/linked_scripts/scripts.lst +++ b/Build/source/texk/texlive/linked_scripts/scripts.lst @@ -25,7 +25,9 @@ pdfjam/pdfpun pdfxup/pdfxup pst-pdf/ps4pdf simpdftex/simpdftex -texosquery/texosquery +texosquery/texosquery.sh +texosquery/texosquery-jre5.sh +texosquery/texosquery-jre8.sh typeoutfileinfo/typeoutfileinfo.sh a2ping/a2ping.pl accfonts/mkt1font diff --git a/Build/source/texk/texlive/linked_scripts/texosquery/texosquery-jre5.sh b/Build/source/texk/texlive/linked_scripts/texosquery/texosquery-jre5.sh new file mode 100755 index 00000000000..67a402279b5 --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/texosquery/texosquery-jre5.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar` +java -jar "$jarpath" "$@" diff --git a/Build/source/texk/texlive/linked_scripts/texosquery/texosquery-jre8.sh b/Build/source/texk/texlive/linked_scripts/texosquery/texosquery-jre8.sh new file mode 100755 index 00000000000..472c531453a --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/texosquery/texosquery-jre8.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar` +java -Djava.locale.providers=CLDR,JRE -jar "$jarpath" "$@" diff --git a/Build/source/texk/texlive/linked_scripts/texosquery/texosquery.sh b/Build/source/texk/texlive/linked_scripts/texosquery/texosquery.sh new file mode 100755 index 00000000000..2f97a43db65 --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/texosquery/texosquery.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar` +java -jar "$jarpath" "$@" diff --git a/Master/bin/amd64-freebsd/texosquery b/Master/bin/amd64-freebsd/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/amd64-freebsd/texosquery +++ b/Master/bin/amd64-freebsd/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/amd64-freebsd/texosquery-jre5 b/Master/bin/amd64-freebsd/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/amd64-freebsd/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/amd64-freebsd/texosquery-jre8 b/Master/bin/amd64-freebsd/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/amd64-freebsd/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/amd64-netbsd/texosquery b/Master/bin/amd64-netbsd/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/amd64-netbsd/texosquery +++ b/Master/bin/amd64-netbsd/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/amd64-netbsd/texosquery-jre5 b/Master/bin/amd64-netbsd/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/amd64-netbsd/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/amd64-netbsd/texosquery-jre8 b/Master/bin/amd64-netbsd/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/amd64-netbsd/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/armel-linux/texosquery b/Master/bin/armel-linux/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/armel-linux/texosquery +++ b/Master/bin/armel-linux/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/armel-linux/texosquery-jre5 b/Master/bin/armel-linux/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/armel-linux/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/armel-linux/texosquery-jre8 b/Master/bin/armel-linux/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/armel-linux/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/armhf-linux/texosquery b/Master/bin/armhf-linux/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/armhf-linux/texosquery +++ b/Master/bin/armhf-linux/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/armhf-linux/texosquery-jre5 b/Master/bin/armhf-linux/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/armhf-linux/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/armhf-linux/texosquery-jre8 b/Master/bin/armhf-linux/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/armhf-linux/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/i386-cygwin/texosquery b/Master/bin/i386-cygwin/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/i386-cygwin/texosquery +++ b/Master/bin/i386-cygwin/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/i386-cygwin/texosquery-jre5 b/Master/bin/i386-cygwin/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/i386-cygwin/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/i386-cygwin/texosquery-jre8 b/Master/bin/i386-cygwin/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/i386-cygwin/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/i386-freebsd/texosquery b/Master/bin/i386-freebsd/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/i386-freebsd/texosquery +++ b/Master/bin/i386-freebsd/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/i386-freebsd/texosquery-jre5 b/Master/bin/i386-freebsd/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/i386-freebsd/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/i386-freebsd/texosquery-jre8 b/Master/bin/i386-freebsd/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/i386-freebsd/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/i386-linux/texosquery b/Master/bin/i386-linux/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/i386-linux/texosquery +++ b/Master/bin/i386-linux/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/i386-linux/texosquery-jre5 b/Master/bin/i386-linux/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/i386-linux/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/i386-linux/texosquery-jre8 b/Master/bin/i386-linux/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/i386-linux/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/i386-netbsd/texosquery b/Master/bin/i386-netbsd/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/i386-netbsd/texosquery +++ b/Master/bin/i386-netbsd/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/i386-netbsd/texosquery-jre5 b/Master/bin/i386-netbsd/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/i386-netbsd/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/i386-netbsd/texosquery-jre8 b/Master/bin/i386-netbsd/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/i386-netbsd/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/i386-solaris/texosquery b/Master/bin/i386-solaris/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/i386-solaris/texosquery +++ b/Master/bin/i386-solaris/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/i386-solaris/texosquery-jre5 b/Master/bin/i386-solaris/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/i386-solaris/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/i386-solaris/texosquery-jre8 b/Master/bin/i386-solaris/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/i386-solaris/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/powerpc-linux/texosquery b/Master/bin/powerpc-linux/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/powerpc-linux/texosquery +++ b/Master/bin/powerpc-linux/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/powerpc-linux/texosquery-jre5 b/Master/bin/powerpc-linux/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/powerpc-linux/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/powerpc-linux/texosquery-jre8 b/Master/bin/powerpc-linux/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/powerpc-linux/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/sparc-solaris/texosquery b/Master/bin/sparc-solaris/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/sparc-solaris/texosquery +++ b/Master/bin/sparc-solaris/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/sparc-solaris/texosquery-jre5 b/Master/bin/sparc-solaris/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/sparc-solaris/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/sparc-solaris/texosquery-jre8 b/Master/bin/sparc-solaris/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/sparc-solaris/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/universal-darwin/texosquery b/Master/bin/universal-darwin/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/universal-darwin/texosquery +++ b/Master/bin/universal-darwin/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/universal-darwin/texosquery-jre5 b/Master/bin/universal-darwin/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/universal-darwin/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/universal-darwin/texosquery-jre8 b/Master/bin/universal-darwin/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/universal-darwin/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/win32/texosquery.exe b/Master/bin/win32/texosquery.exe deleted file mode 100755 index 5777d90a17a..00000000000 Binary files a/Master/bin/win32/texosquery.exe and /dev/null differ diff --git a/Master/bin/x86_64-cygwin/texosquery b/Master/bin/x86_64-cygwin/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/x86_64-cygwin/texosquery +++ b/Master/bin/x86_64-cygwin/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/x86_64-cygwin/texosquery-jre5 b/Master/bin/x86_64-cygwin/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/x86_64-cygwin/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/x86_64-cygwin/texosquery-jre8 b/Master/bin/x86_64-cygwin/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/x86_64-cygwin/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/x86_64-darwin/texosquery b/Master/bin/x86_64-darwin/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/x86_64-darwin/texosquery +++ b/Master/bin/x86_64-darwin/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/x86_64-darwin/texosquery-jre5 b/Master/bin/x86_64-darwin/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/x86_64-darwin/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/x86_64-darwin/texosquery-jre8 b/Master/bin/x86_64-darwin/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/x86_64-darwin/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/x86_64-linux/texosquery b/Master/bin/x86_64-linux/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/x86_64-linux/texosquery +++ b/Master/bin/x86_64-linux/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/x86_64-linux/texosquery-jre5 b/Master/bin/x86_64-linux/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/x86_64-linux/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/x86_64-linux/texosquery-jre8 b/Master/bin/x86_64-linux/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/x86_64-linux/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/bin/x86_64-solaris/texosquery b/Master/bin/x86_64-solaris/texosquery index 507d22edfe4..2946bce9d51 120000 --- a/Master/bin/x86_64-solaris/texosquery +++ b/Master/bin/x86_64-solaris/texosquery @@ -1 +1 @@ -../../texmf-dist/scripts/texosquery/texosquery \ No newline at end of file +../../texmf-dist/scripts/texosquery/texosquery.sh \ No newline at end of file diff --git a/Master/bin/x86_64-solaris/texosquery-jre5 b/Master/bin/x86_64-solaris/texosquery-jre5 new file mode 120000 index 00000000000..5bc0a41e3a3 --- /dev/null +++ b/Master/bin/x86_64-solaris/texosquery-jre5 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre5.sh \ No newline at end of file diff --git a/Master/bin/x86_64-solaris/texosquery-jre8 b/Master/bin/x86_64-solaris/texosquery-jre8 new file mode 120000 index 00000000000..96251bb6b92 --- /dev/null +++ b/Master/bin/x86_64-solaris/texosquery-jre8 @@ -0,0 +1 @@ +../../texmf-dist/scripts/texosquery/texosquery-jre8.sh \ No newline at end of file diff --git a/Master/texmf-dist/doc/support/texosquery/CHANGES b/Master/texmf-dist/doc/support/texosquery/CHANGES index 86ae40b460c..ba18c85d3d5 100644 --- a/Master/texmf-dist/doc/support/texosquery/CHANGES +++ b/Master/texmf-dist/doc/support/texosquery/CHANGES @@ -1,3 +1,109 @@ +1.2 (2017/03/23): + + * Now has three .jar files depending on the Java installation: + + - texosquery-jre8.jar + + Full application. May be used with the CLDR locale provider + (Unicode Consortium's Common Locale Data Repository). + Requires at least Java 8 (use with + java -Djava.locale.providers=CLDR,JRE or + add "java.locale.providers=CLDR,JRE" to the + JAVA_TOOLS_OPTIONS environment variable to access the CLDR) + + - texosquery.jar + + The default version of the application. Can't be used with + CLDR. Less locale support. Requires at least Java 7. + + - texosquery-jre5.jar + + Cut-down version of the application with significantly less + locale support. Provided for old systems that can't upgrade, + but not recommended. (Use of Java 5 or 6 is deprecated.) + Requires at least Java 5. + + * Corresponding scripts that run the appropriate .jar file + are bundled in texosquery.dtx and extracted using: + + tex texosquery.ins + + - Unix-like (run `chmod +x texosquery*.sh`): + + texosquery-jre8.sh : runs texosquery-jre8.jar with + -Djava.locale.providers=CLDR,JRE + + texosquery.sh : runs texosquery.jar + + texosquery-jre5.sh : runs texosquery-jre5.jar + + (I recommend the removal of the '.sh' extension + for more convenient invocation.) + + - Windows (rename texosquery*.batch to texosquery*.bat): + + texosquery-jre8.bat : runs texosquery-jre8.jar with + -Djava.locale.providers=CLDR,JRE + + texosquery.bat : runs texosquery.jar + + texosquery-jre5.bat : runs texosquery-jre5.jar + + You can edit these files if additional Java settings + are required (e.g. -Dfile.encoding=UTF-8). Alternatively + set the JAVA_TOOLS_OPTIONS environment variable. + + * New texosquery.cfg configuration file. Edit the definition + of \TeXOSInvokerName to indicate which application you + need to use. For example, if Java 8 is installed: + + \def\TeXOSInvokerName{texosquery-jre8} + + See the installation section of the manual. + + * New command line switches: + + Actions: + + --bcp47 / -b + --codeset-lcs / -C + --locale-data / -D + --numeric / -N + --date-time / -M + --time-zones / -Z + --list-dir / -ld + --list-regular / -lr + --filterlist-dir / -fd + --filterlist-regular / -fr + --walk / -w + + Options: + + --debug [⟨n⟩] + --nodebug + --compatible ⟨n⟩ / -compat ⟨n⟩ + + * Actions --list (-i) and --filterlist (-f) now have an + optional argument to indicate the sort order. + + * When accessing file information, the TEXMF openin_any + setting is first checked to determine if read access is + permitted. + + * Returned values now include some shorthand markup that's + internally converted when read in by \TeXOSQuery. For + example "texosquery -n" now returns + + \pdfd \fcln 20161113161156\fpls 00\fcsq 00\fcsq + + instead of + + D:20161113161156+00'00' + + To restore the original behaviour use --compatible 1 + + See the manual for further details. + 1.1 (2016-07-14): * texosquery.jar: diff --git a/Master/texmf-dist/doc/support/texosquery/Manifest.txt b/Master/texmf-dist/doc/support/texosquery/Manifest.txt deleted file mode 100644 index 92d656204b2..00000000000 --- a/Master/texmf-dist/doc/support/texosquery/Manifest.txt +++ /dev/null @@ -1,2 +0,0 @@ -Main-Class: com/dickimawbooks/texosquery/TeXOSQuery -Class-Path: . diff --git a/Master/texmf-dist/doc/support/texosquery/README.md b/Master/texmf-dist/doc/support/texosquery/README.md index 49b390d55a3..bad3733503a 100644 --- a/Master/texmf-dist/doc/support/texosquery/README.md +++ b/Master/texmf-dist/doc/support/texosquery/README.md @@ -4,7 +4,8 @@ TeX's shell escape mechanism. The application can query the following: - - locale and codeset + - locale information + - default file encoding - current working directory - user home directory - temporary directory @@ -24,42 +25,162 @@ The application can query the following: All paths use a forward slash as directory divider so results can be used, for example, in commands like `\includegraphics`. -There are files provided for easy access in TeX documents: +There are files provided for easy access in (La)TeX documents: - `texosquery.tex` : generic TeX code - `texosquery.sty` : LaTeX package -This provides commands to run `texosquery` using TeX's shell -escape mechanism and capture the result in a control sequence. -The category code of most of TeX's default special characters -(and some other potentially problematic characters) is temporarily -changed to 12 while reading the result. +This provides the command `\TeXOSQuery` to run `texosquery` using +TeX's shell escape mechanism and capture the result in a control +sequence. The category code of most of TeX's default special +characters (and some other potentially problematic characters) is +temporarily changed to 12 while reading the result. Some of the +`texosquery` output contains short markup commands (such as `\wrp`) +which are internally converted within `\TeXOSQuery`. ## Installation -The actual Java application is in `texosquery.jar`. -The `.tex` and `.sty` files can be extracted from `texosquery.dtx` -using `tex texosquery.ins`. In the following, replace TEXMF with the -path to your TEXMF directory. - - - Move `texosquery.tex` to `TEXMF/tex/generic/texosquery/` - - Move `texosquery.sty` to `TEXMF/tex/latex/texosquery/` - - Move `texosquery.pdf` to `TEXMF/doc/generic/texosquery/` - - Move `texosquery.jar` to `TEXMF/scripts/texosquery/` - -Unix-like users: move the bash script `texosquery` to somewhere on -your path. - -Windows users: TeX Live's generic wrapper should be able to locate -the `texosquery.jar` file, but if not or you're not using TL, -then (untested) create a file called `texosquery.bat` that contains: -```dos -@ECHO OFF -FOR /F %%I IN ('kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar') DO SET JARPATH=%%I -START javaw -jar "%JARPATH%\texosquery.jar" %* +Installation is best done using your TeX package manager. +Manual installation instructions are described below. +For more detail, see the documentation. + +### Compiling the Documentation + +To compile the documentation: +```bash +pdflatex texosquery.dtx +makeglossaries texosquery +makeindex -s gglo.ist -t texosquery.glg -o texosquery.gls texosquery.glo +pdflatex texosquery.dtx +makeindex -s gind.ist texosquery.idx +pdflatex texosquery.dtx +pdflatex texosquery.dtx ``` -(or skip the `FOR` line and replace `%JARPATH%` with the full path name to -`texosquery.jar`.) Put this file on your system's path. + +### Extracting the Files + +Except for the `.jar` files, the `texosquery` files are all +bundled inside `texosquery.dtx` with the extraction commands +provided in `texosquery.ins`. To extract all the files do: +```bash +tex texosquery.ins +``` + +The `.sh` files are bash scripts for Unix-like users. These will +need to be set to executable using `chmod`. I recommend +that you also remove the `.sh` extension. Windows users can +deleted these files. + +The `.batch` files are batch scripts for Windows users. Unix-like +users can delete these files. These files are given the extension +`.batch` as TeX on Windows doesn't allow the creation of `.bat` +files. The extension will need to be changed to `.bat` after the +files have been extracted. + +### Installing the Application + +In the following, replace _TEXMF_ with the path to your TEXMF directory. +You can find your home TEXMF directory using +```bash +kpsewhich -var-value=TEXMFHOME +``` + +There are now three Java applications provided by this package: + + - `texosquery.jar` (requires at least Java 7) + - `texosquery-jre8.jar` (requires at least Java 8) + - `texosquery-jre5.jar` (requires at least Java 5) + +There are corresponding bash scripts for Unix-like users (the `.sh` +extension added by `texosquery.ins` should be removed and the files +made executable): + + - `texosquery` + - `texosquery-jre8` + - `texosquery-jre5` + +There are also corresponding batch scripts for Windows users (the `.batch` +extension created by the `.ins` file should be changed to `.bat`): + + - `texosquery.bat` + - `texosquery-jre8.bat` + - `texosquery-jre5.bat` + +Each script uses `kpsewhich` to find the corresponding `.jar` file +and runs it. + +Put the `.jar` files in _TEXMF_`/scripts/texosquery/` and the +bash or `.bat` files somewhere on your path. You may or may not need +to refresh the TeX database. + +To test the installation, run +```bash +texosquery -v +``` +in the command prompt or terminal. (Also try with `texosquery-jre8` +and `texosquery-jre5`.) + +If successful, it should show the version number. + +### Installing the TeX Code + +The `.tex`, `.cfg` and `.sty` files should all be extracted from `texosquery.dtx` +with `tex texosquery.ins` as described above. + + - Move `texosquery.tex` to _TEXMF_`/tex/generic/texosquery/` + - Move `texosquery.cfg` to _TEXMF_`/tex/generic/texosquery/` + - Move `texosquery.sty` to _TEXMF_`/tex/latex/texosquery/` + - Move `texosquery.pdf` to _TEXMF_`/doc/generic/texosquery/` + +The `texosquery.cfg` file allows you to specify which application you +want to use. First check which version of the Java Runtime +Environment (JRE) you have installed: +```bash +java -version +``` +This should display the version information. (For example, `"1.8.0_92"`) + +If the version number starts with `1.8` (“Java 8”), then you can use `texosquery-jre8.jar`. +This is the full application. You can use `texosquery` or +`texosquery-jre5` as well, but there's less locale support with them. +The `texosquery-jre8` bash script and `texosquery-jre8.bat` batch script invokes Java with +`-Djava.locale.providers=CLDR,JRE`. + +If Windows users have simply been supplied with an executable versions +of the `texosquery-jre8.jar` file (`texosquery-jre8.exe`) then you'll have to set the +`JAVA_TOOL_OPTIONS` environment variable instead. + +This `java.locale.providers` setting allows Java to access locale +information from the [Unicode Common Locale Data Repository +(CLDR)](http://cldr.unicode.org/) installed on their system. The +pending Java 9 should include this by default, so this will only be +relevant to Java 8. Earlier versions of Java (7 or below) don't have +this option, which limits the locale support to that which is +natively provided by the JRE. + +If the version information starts with `1.7` (“Java 7”), then you can use +`texosquery.jar`. This is the default application and provides most +of the functions of the full application, but there's less locale support. +You can also use the even more limited `texosquery-jre5`, but you can't use +`texosquery-jre8`, so you can't take advantage of the CLDR. + +If the version information starts with `1.5` (“Java 5”) or `1.6` +(“Java 6”), then you can _only_ use `texosquery-jre5`. The locale +support is significantly reduced in this case and there's no support +for language scripts. Note that these versions of Java are +deprecated. + +Once you have determined which application you want to use, edit the +`texosquery.cfg` so that `\TeXOSInvokerName` is defined to the appropriate invocation. For example, with Java 8: +```tex +\def\TeXOSInvokerName{texosquery-jre8} +``` +or with Java 5 or 6: +```tex +\def\TeXOSInvokerName{texosquery-jre5} +``` +(bash users will have to add the `.sh` extension if it hasn't +been removed, as per the above instructions.) ## Examples: @@ -69,8 +190,11 @@ Plain TeX: % arara: pdftex: {shell: on} \input texosquery +\TeXOSQuery{\result}{-b} +IEFT BCP 47 language tag: \result. + \TeXOSQueryLocale{\result} -locale: \result. +POSIX locale: \result. \TeXOSQueryCwd{\result} cwd: {\tt \result}. @@ -98,8 +222,11 @@ LaTeX: \begin{document} +\TeXOSQuery{\result}{-b} +IEFT BCP 47 language tag: \result. + \TeXOSQueryLocale{\result} -locale: \result. +POSIX locale: \result. \TeXOSQueryCwd{\result} cwd: \texttt{\result}. @@ -125,39 +252,39 @@ All jpg and png files in current directory: For a full list of available commands, see the documentation (`texosquery.pdf`). -You can omit `texosquery.tex` and directly use `texosquery` -in TeX's shell escape, but take care of special characters -occurring in the result or if double-quotes occur in -`\jobname`. - ## Source code -The `.tex` and `.sty` files and documentation are contained in -`texosquery.dtx`. To compile the documentation: -```bash -pdflatex texosquery.dtx -makeindex -s gglo.ist -t texosquery.glg -o texosquery.gls texosquery.glo -makeindex -s gind.ist texosquery.idx -pdflatex texosquery.dtx -pdflatex texosquery.dtx -``` - -The Java source is in `TeXOSQuery.java` and the manifest for the -`.jar` file is `Manifest.txt`. Assuming the following directory -structure: +The Java source is in the `.java` files and the manifest for each +`.jar` file is `Manifest*.txt` (`Manifest-jre8.txt` for `texosquery-jre8` etc). +Assuming the following directory structure: ``` java/TeXOSQuery.java -java/Manifest.txt +java/TeXOSQueryJRE5.java +java/TeXOSQueryJRE7.java +java/TeXOSQueryJRE8.java +java/QueryAction.java +java/QueryActionType.java +java/FileSortType.java +java/FileSortComparator.java +java/FileListType.java +java/FileWalkVisitor.java +java/Manifest-jre5.txt +java/Manifest-jre7.txt +java/Manifest-jre8.txt classes/com/dickimawbooks/texosquery/ ``` -Then to create `texosquery.jar`, do: +Then to create `texosquery-jre8.jar`, do (for JDK version 1.8): ```bash cd java -javac -d ../classes TeXOSQuery.java +javac -d ../classes TeXOSQuery.java QueryAction.java QueryActionType.java TeXOSQueryJRE8.java FileSortType.java FileSortComparator.java FileListType.java FileWalkVisitor.java cd ../classes -jar cmf ../java/Manifest.txt ../texosquery.jar com/dickimawbooks/texosquery/*.class +jar cmf ../java/Manifest-jre8.txt ../texosquery-jre8.jar com/dickimawbooks/texosquery/*.class ``` +Similarly for the other `.jar` files, replacing `8` with `7` or `5`. +(The Java 7 version should really be `texosquery-jre7.jar`, but is +simply named `texosquery.jar` in the distribution for backward compatibility reasons. If you compile the code, the `.jar` name is your choice.) + --- Source on GitHub: https://github.com/nlct/texosquery diff --git a/Master/texmf-dist/doc/support/texosquery/texosquery.pdf b/Master/texmf-dist/doc/support/texosquery/texosquery.pdf index 7471094188a..a1b3862d24f 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 b/Master/texmf-dist/scripts/texosquery/texosquery deleted file mode 100755 index 2f97a43db65..00000000000 --- a/Master/texmf-dist/scripts/texosquery/texosquery +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar` -java -jar "$jarpath" "$@" diff --git a/Master/texmf-dist/scripts/texosquery/texosquery-jre5.jar b/Master/texmf-dist/scripts/texosquery/texosquery-jre5.jar new file mode 100755 index 00000000000..63d0fc4f9b3 Binary files /dev/null and b/Master/texmf-dist/scripts/texosquery/texosquery-jre5.jar differ diff --git a/Master/texmf-dist/scripts/texosquery/texosquery-jre5.sh b/Master/texmf-dist/scripts/texosquery/texosquery-jre5.sh new file mode 100755 index 00000000000..67a402279b5 --- /dev/null +++ b/Master/texmf-dist/scripts/texosquery/texosquery-jre5.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre5.jar` +java -jar "$jarpath" "$@" diff --git a/Master/texmf-dist/scripts/texosquery/texosquery-jre8.jar b/Master/texmf-dist/scripts/texosquery/texosquery-jre8.jar new file mode 100755 index 00000000000..06f3b342b51 Binary files /dev/null and b/Master/texmf-dist/scripts/texosquery/texosquery-jre8.jar differ diff --git a/Master/texmf-dist/scripts/texosquery/texosquery-jre8.sh b/Master/texmf-dist/scripts/texosquery/texosquery-jre8.sh new file mode 100755 index 00000000000..472c531453a --- /dev/null +++ b/Master/texmf-dist/scripts/texosquery/texosquery-jre8.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery-jre8.jar` +java -Djava.locale.providers=CLDR,JRE -jar "$jarpath" "$@" diff --git a/Master/texmf-dist/scripts/texosquery/texosquery.jar b/Master/texmf-dist/scripts/texosquery/texosquery.jar index 84f4c1140a2..feb800910ab 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/scripts/texosquery/texosquery.sh b/Master/texmf-dist/scripts/texosquery/texosquery.sh new file mode 100755 index 00000000000..2f97a43db65 --- /dev/null +++ b/Master/texmf-dist/scripts/texosquery/texosquery.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +jarpath=`kpsewhich --progname=texosquery --format=texmfscripts texosquery.jar` +java -jar "$jarpath" "$@" diff --git a/Master/texmf-dist/source/support/texosquery/TeXOSQuery.java b/Master/texmf-dist/source/support/texosquery/TeXOSQuery.java deleted file mode 100644 index dca8fa7c32d..00000000000 --- a/Master/texmf-dist/source/support/texosquery/TeXOSQuery.java +++ /dev/null @@ -1,767 +0,0 @@ -package com.dickimawbooks.texosquery; - -import java.io.BufferedReader; -import java.util.Locale; -import java.util.Calendar; -import java.io.File; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -/** - * Main class. - * @author Nicola Talbot - * @version 1.1 - * @since 1.0 - */ -public class TeXOSQuery { - - private static final String VERSION_NUMBER = "1.1"; - private static final String VERSION_DATE = "2016-07-14"; - private static final char BACKSLASH = '\\'; - private static final char FORWARDSLASH = '/'; - private static final long ZERO = 0L; - - /** - * Escapes hash from input string. - * @param string Input string. - * @return String with hash escaped. - */ - private static String escapeHash(String string) { - return string.replaceAll("#", "\\\\#"); - } - - /** - * Gets a string representation of the provided locale. - * @param locale The provided locale. - * @return String representation. - */ - private static String getLocale(Locale locale) { - return getLocale(locale, false); - } - - /** - * Gets a string representation of the provided locale, converting the code - * set if possible. - * @param locale The provided locale. - * @param convertCodeset Boolean value to convert the code set. - * @return String representation. - */ - private static String getLocale(Locale locale, boolean convertCodeset) { - - String identifier = ""; - - if (locale != null) { - - String language = locale.getLanguage(); - - if (language != null) { - identifier = language; - } - - String country = locale.getCountry(); - - if ((country != null) && - (!"".equals(country))) { - - if ("".equals(identifier)) { - identifier = country; - } else { - identifier = identifier.concat("-").concat(country); - } - - } - - String codeset = System.getProperty("file.encoding", "UTF-8"); - - if ((codeset != null) && - (!"".equals(codeset))) { - - if (convertCodeset) { - codeset = codeset.toLowerCase().replaceAll("-", ""); - } - - identifier = identifier.concat(".").concat(codeset); - } - - String script = locale.getScript(); - - if ((script != null) && - (!"".equals(script))) { - identifier = identifier.concat("@").concat(escapeHash(script)); - } - - } - - return identifier; - } - - /** - * Gets the OS name. - * @return The OS name as string. - */ - private static String getOSname() { - return getSystemProperty("os.name"); - } - - /** - * Gets the OS architecture. - * @return The OS architecture as string. - */ - private static String getOSarch() { - return getSystemProperty("os.arch"); - } - - /** - * Gets the OS version. - * @return The OS version as string. - */ - private static String getOSversion() { - return getSystemProperty("os.version"); - } - - /** - * Gets the user home. - * @return The user home as string. - */ - private static String getUserHome() { - return getSystemProperty("user.home"); - } - - /* - * - */ - /** - * Converts the filename string to TeX path. Since this is designed to work - * within TeX, backslashes in paths need to be replaced with forward - * slashes. - * @param filename The filename string. - * @return TeX path. - */ - private static String toTeXPath(String filename) { - - String path = ""; - - if (filename != null) { - if (File.separatorChar == BACKSLASH) { - filename = filename.replaceAll("\\\\", "/"); - } - path = escapeHash(filename); - } - - return path; - } - - /** - * Converts the TeX path back to the original representation. - * @param filename The filename string. - * @return The original representation. - */ - private static String fromTeXPath(String filename) { - - if (File.separatorChar != FORWARDSLASH) { - filename = filename.replaceAll("/", File.separator); - } - - return filename; - } - - /** - * Gets a file representation from a filename string. - * @param filename Filename string. - * @return File representation - */ - private static File fileFromTeXPath(String filename) { - - filename = fromTeXPath(filename); - File file = new File(filename); - - if (!file.exists() && file.getParent() == null) { - - try { - Process process = new ProcessBuilder( - "kpsewhich", - filename - ).start(); - - if (process.waitFor() == 0) { - - InputStream stream = process.getInputStream(); - - if (stream != null) { - - BufferedReader reader = new BufferedReader( - new InputStreamReader(stream) - ); - - String line = reader.readLine(); - reader.close(); - - if ((line != null) && (!"".equals(line))) { - file = new File(fromTeXPath(line)); - } - } - } - } catch (IOException exception1) { - // quack quack - } catch (InterruptedException exception2) { - // quack quack - } - } - - return file; - } - - /** - * Gets the current working directory. - * @return The current working directory. - */ - private static String getCwd() { - return getSystemProperty("user.dir"); - } - - /** - * Gets the temporary directory. - * @return Temporary directory. - */ - private static String getTmpDir() { - return getSystemProperty("java.io.tmpdir"); - } - - /** - * Gets the current date. - * @return The current date. - */ - private static String pdfnow() { - return pdfDate(Calendar.getInstance()); - } - - /** - * Gets the date in an specific format. - * @param calendar A calendar object. - * @return Date in an specific format. - */ - private static String pdfDate(Calendar calendar) { - String tz = String.format("%1$tz", calendar); - return String.format( - "D:%1$tY%1$tm%1td%1$tH%1$tM%1$tS%2$s'%3$s'", - calendar, - tz.substring(0, 3), - tz.substring(3) - ); - } - - /** - * Gets the date from a file. - * @param file File. - * @return The date in an specific format. - */ - private static String pdfDate(File file) { - - String date = ""; - - try { - long millisecs = file.lastModified(); - - if (millisecs > ZERO) { - - Calendar calendar = Calendar.getInstance(); - calendar.setTimeInMillis(millisecs); - date = pdfDate(calendar); - - } - } catch (SecurityException exception) { - // quack quack - } - - return date; - } - - /** - * Gets the file length. - * @param file The file. - * @return The length as a string. - */ - private static String getFileLength(File file) { - - String output = ""; - - try { - long length = file.length(); - - if (length > ZERO) { - output = String.format("%d", length); - } - } catch (SecurityException exception) { - // quack quack - } - - return output; - } - - /** - * Gets the list of files from a directory. - * @param separator Separator. - * @param directory Directory. - * @return List as a string. - */ - private static String getFileList(String separator, File directory) { - - StringBuilder builder = new StringBuilder(); - - if (directory.isDirectory()) { - - try { - - String[] list = directory.list(); - if (list != null) { - - for (int i = 0; i < list.length; i++) { - - if (i > 0) { - builder.append(separator); - } - - builder.append(escapeHash(list[i])); - - } - } - - } catch (SecurityException exception) { - // quack quack - } - } - - return builder.toString(); - } - - /** - * Gets a filtered list of files from directory. - * @param separator Separator. - * @param regex Regular expression. - * @param directory Directory. - * @return Filtered list as string. - */ - private static String getFilterFileList(String separator, - final String regex, File directory) { - - StringBuilder builder = new StringBuilder(); - - if (directory.isDirectory()) { - - if ((regex == null) || ("".equals(regex))) { - builder.append(getFileList(separator, directory)); - } - else { - try { - String[] list = directory.list(new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.matches(regex); - } - }); - - if (list != null) { - - for (int i = 0; i < list.length; i++) { - - if (i > 0) { - builder.append(separator); - } - - builder.append(escapeHash(list[i])); - } - - } - } catch (SecurityException exception) { - // quack quack - } - } - } - - return builder.toString(); - } - - /** - * Gets the file URI. - * @param file The file. - * @return The URI. - */ - private static String fileURI(File file) { - - String uri = ""; - - if (file.exists()) { - try { - uri = file.toURI().toString(); - } catch (SecurityException exception) { - // quack quack - } - } - - return uri; - } - - /** - * Gets the file path. - * @param file The file. - * @return The path. - */ - private static String filePath(File file) { - - String path = ""; - - if (file.exists()) { - try { - path = toTeXPath(file.getCanonicalPath()); - } catch (SecurityException exception1) { - // quack quack - } catch (IOException exception2) { - // quack quack - } - } - - return path; - } - - /** - * Gets the path for the file's parent. - * @param file The file. - * @return The path. - */ - private static String parentPath(File file) { - - String path = ""; - - if (file.exists()) { - try { - path = toTeXPath(file.getCanonicalFile().getParent()); - } catch (SecurityException exception1) { - // quack quack - } catch (IOException exception2) { - // quack quack - } - } - - return path; - } - - /** - * Prints the syntax usage. - */ - private static void syntax() { - System.out.println("Usage: texosquery