4 # This file is part of LyX, the document processor.
5 # Licence details can be found in the file COPYING.
8 # author Jean-Marc Lasgouttes
9 # author Jürgen Spitzmüller
11 # Full author contact details are available in file CREDITS.
13 # all files -> without option
14 # TeX class files -> option cls
15 # TeX style files -> option sty
16 # bibtex style files -> option bst
17 # bibtex database files -> option bib
20 # of kpsewhich and creates a
21 # bstFiles.lst, clsFiles.lst, styFiles.lst, bibFiles.lst
22 # without any parameter all files are created.
24 # Herbert Voss <voss@perce.org>
26 # Updates from Jean-Marc Lasgouttes.
28 # bib support added by Juergen Spitzmueller (v0.3)
30 CLS_STYLEFILE=clsFiles.lst
31 STY_STYLEFILE=styFiles.lst
32 BST_STYLEFILE=bstFiles.lst
33 BIB_FILES=bibFiles.lst
34 version='$Id: TeXFiles.sh,v 0.3 2003-02-14'
35 progname=`echo $0 | sed 's%.*/%%'`
36 usage="Usage: TeXFiles.sh [-version | cls | sty | bst | bib ]
37 Default is without any Parameters,
38 so that all files will be created"
41 test -z "$types" && types="cls sty bst bib"
44 # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use ';' to separate
45 # directories in path lists whereas Unixes uses ':'.
46 # $SEP holds the right character to be used by the scripts.
49 # never used this one with windows and what happens with mac??
52 if test -z "$COMSPEC" && test -z "$ComSpec"; then SEP=':'; else SEP=';'; fi
55 # A copy of some stuff from mktex.opt, so we can run in the presence of
56 # terminally damaged ls-R files.
58 if test "x$1" = x--help || test "x$1" = x-help; then
61 elif test "x$1" = x--version || test "x$1" = x-version; then
62 echo "`basename $0` $version"
67 for type in $types ; do
68 echo "Indexing files of type $type"
70 cls) outfile=$CLS_STYLEFILE
72 sty) outfile=$STY_STYLEFILE
74 bst) outfile=$BST_STYLEFILE
76 bib) outfile=$BIB_FILES
78 *) echo "ERROR: unknown type $type"
85 dirs=`kpsewhich --show-path=$kpsetype 2>/dev/null | tr "$SEP" " " | sed -e 's%/\{2,\}%/%g' -e 's%!!%%g'`
88 find $dir -follow -name "*.$type" >>$outfile 2>/dev/null
92 #echo "list saved in $STYLEFILE"
93 #echo `wc -l $CLS_STYLEFILE` # only for information
95 # this is the end my friends ... Jim Morrison and the Doors in "The End"