summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/texlive-extra/kpsetool.sh
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-01-26 23:58:37 +0000
committerKarl Berry <karl@freefriends.org>2020-01-26 23:58:37 +0000
commitcb1f34f8bcabffe0473d760bf9dd3343f8db537c (patch)
treee5ab8f61ef2d5f8a2e641e760b21e3edd118cc05 /Master/texmf-dist/scripts/texlive-extra/kpsetool.sh
parent767a4e654de5f47d7bb5c671f0df58918cc6347b (diff)
tetex.tlpsrc: remove.
scheme-infraonly.tlpsrc, collection-basic.tlpsrc: no more tetex. texlive.infra.tlpsrc: move fmtutil-hdr.cnf and updmap-hdr.cfg to texlive-scripts, where the scripts are. texmf-dist/doc/tetex: also remove, too old. texmf-dist/scripts/texlive-extra: add remaining auxiliary scripts from tl_scripts, from tetex days. <many>.sh, e2pall.pl: move there (from Build/../tlscripts/). texlive-extra.tlpsrc: new package. collection-binextra.tlpsrc: add texlive-extra here. bin/*/all*: adjust symlinks. Build/.../texlive/linked_scripts/texlive-extra: add new scripts. Adjust Makefile.am, including creating mktexfmt symlink. Build/.../texlive/tl_scripts: remove all scripts from here, leaving only man pages. tl-check-wrapper-consistency: no more scripts in tl_scripts (will rename directory later). git-svn-id: svn://tug.org/texlive/trunk@53554 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/texlive-extra/kpsetool.sh')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive-extra/kpsetool.sh118
1 files changed, 118 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/texlive-extra/kpsetool.sh b/Master/texmf-dist/scripts/texlive-extra/kpsetool.sh
new file mode 100755
index 00000000000..463097fd4a9
--- /dev/null
+++ b/Master/texmf-dist/scripts/texlive-extra/kpsetool.sh
@@ -0,0 +1,118 @@
+#!/bin/sh
+
+# kpsetool. Script to make teTeX-style kpsetool, kpsexpand and kpsepath
+# available. Web2C's kpsewhich offers a superset of the functionality.
+# For compatibilty with old versions of teTeX, this script provides the
+# old command line interface of kpsetool, kpsexpand and kpsepath. All the
+# real work is done inside Web2C's kpsewhich.
+# Thomas Esser <te@dbs.uni-hannover.de>, Mar 1997, public domain.
+
+export PATH
+
+usage="
+Usage: kpsexpand [options] string
+Usage: kpsetool -w [options] pathtype filename
+Usage: kpsepath [options] pathtype
+
+Valid options are the following:
+ -n progname : pretend to be progname to kpathsea
+ -m mode : set Metafont mode
+ -w : locate files (similar to kpsewhich)
+ -p : act like kpsepath
+ -v : act like kpsexpand
+
+Valid pathtypes are:
+ gf : generic font bitmap
+ pk : packed bitmap font
+ base : Metafont memory dump
+ bib : BibTeX bibliography source
+ bst : BibTeX style files
+ cnf : Kpathsea runtime configuration files
+ fmt : TeX memory dump
+ mem : MetaPost memory dump
+ mf : Metafont source
+ mfpool : Metafont program strings
+ mp : MetaPost source
+ mppool : MetaPost program strings
+ mpsupport : MetaPost support files
+ pict : Other kinds of figures
+ tex : TeX source
+ texpool : TeX program strings
+ tfm : TeX font metrics
+ vf : virtual font
+ dvips_config : dvips config files
+ dvips_header : dvips header files
+ troff_font : troff fonts
+"
+
+action=kpsexpand
+case $0 in
+ */kpsewhich) action=kpsewhich;;
+ */kpsepath) action=kpsepath;;
+esac
+
+progname=`echo $0 | sed 's@.*/@@'`
+flags=''
+
+while true; do
+ case x"$1" in
+ x-n)
+ if test $# = 1; then
+ echo "$progname: missing argument for -n."
+ echo "$usage"; exit 1
+ else
+ flags="$flags -progname=$2"; shift; shift
+ fi;;
+ x-m)
+ if test $# = 1; then
+ echo "$progname: missing argument for -m."
+ echo "$usage"; exit 1
+ else
+ flags="$flags -mode=$2"; shift; shift
+ fi;;
+ x-w) action=kpsewhich; shift;;
+ x-p) action=kpsepath; shift;;
+ x-v) action=kpsexpand; shift;;
+ *) break;;
+ esac
+done
+
+case "$action" in
+ kpsewhich|kpsepath)
+ case "$1" in
+ gf) format='gf';;
+ pk) format='pk';;
+ base) format='.base';;
+ bib) format='.bib';;
+ bst) format='.bst';;
+ cnf) format='.cnf';;
+ fmt) format='.fmt';;
+ mem) format='.mem';;
+ mf) format='.mf';;
+ mfpool) format='.pool';;
+ mp) format='.mp';;
+ mppool) format='.pool';;
+ mpsupport) format='MetaPost support';;
+ pict) format='.eps';;
+ tex) format='.tex';;
+ texpool) format='.pool';;
+ tfm) format='.tfm';;
+ vf) format='.vf';;
+ dvips_config) format='dvips config';;
+ dvips_header) format='.pro';;
+ troff_font) format='Troff fonts';;
+ *) echo "$progname: $1: unknown format"; echo "$usage"; exit 1;;
+ esac
+ shift;;
+esac
+
+case "$action" in
+ kpsewhich)
+ test $# = 1 || { echo "$progname: missing filename"; echo "$usage"; exit 1; }
+ kpsewhich $flags -format="$format" "$1";;
+ kpsepath)
+ kpsewhich $flags -show-path="$format";;
+ kpsexpand)
+ test $# = 1 || { echo "$progname: missing string"; echo "$usage"; exit 1; }
+ kpsewhich $flags -expand-var="$1";;
+esac