diff options
author | Olaf Weber <olaf@infovore.xs4all.nl> | 2008-07-17 17:34:33 +0000 |
---|---|---|
committer | Olaf Weber <olaf@infovore.xs4all.nl> | 2008-07-17 17:34:33 +0000 |
commit | 6004974d246907fa8f734c225d71d5c0ba0c2157 (patch) | |
tree | 3195a48c605eadf869c95bb89c3b9400a0cf5e5c /Master/bin/mips-irix/mktexlsr | |
parent | 55b6390d0fab9ddc5918cb45f0ada0fb4824e201 (diff) |
Updated IRIX binaries.
git-svn-id: svn://tug.org/texlive/trunk@9634 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin/mips-irix/mktexlsr')
-rwxr-xr-x | Master/bin/mips-irix/mktexlsr | 110 |
1 files changed, 72 insertions, 38 deletions
diff --git a/Master/bin/mips-irix/mktexlsr b/Master/bin/mips-irix/mktexlsr index 9f729e4d495..2c4ac96f3dd 100755 --- a/Master/bin/mips-irix/mktexlsr +++ b/Master/bin/mips-irix/mktexlsr @@ -5,25 +5,32 @@ # installation won't write this script over yours.) # # Suitable for calling from cron, as in: -# 0 * * * * cd /your/texmf/root && /usr/local/bin/mktexlsr -# unless the scripts live in a different directory than the 'kpseaccess', -# 'kpsestat', 'kpsereadlink', and 'kpsewhich' binaries. +# 0 * * * * cd /your/texmf/root && /usr/local/texlive/bin/mktexlsr # # Originally written as `texhash' by Thomas Esser # <te@dbs.uni-hannover.de>, Okt., 1994. # Public domain. -version='$Id: mktexlsr,v 1.46 2005/06/21 14:32:26 olaf Exp $' +version='$Id: mktexlsr 9164 2008-07-02 17:42:11Z karl $' progname=`echo $0 | sed 's%.*/%%'` usage="Usage: $progname [DIR]... -Only options are --help, --version, and --verbose. If standard input is -a terminal, --verbose is on by default. +Rebuild ls-R filename databases. If one or more arguments DIRS are +given, these are used as the directories in which to build ls-R. Else +all directories in the search path for ls-R files (\$TEXMFDBS) are used. -Rebuild all necessary ls-R filename databases completely. If one or -more arguments DIRS are given, these are used as texmf directories to -build ls-R for. Else all directories in the search path for ls-R files -(\$TEXMFDBS) are used." +Options: + --dry-run do not actually update anything + --help display this help and exit + --quiet cancel --verbose + --silent same as --quiet + --verbose explain what is being done + --version output version information and exit + +If standard input is a terminal, --verbose is on by default. + +Report bugs to tex-k@tug.org. +" # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate # directories in path lists whereas Unix uses `:'. Make an exception for @@ -52,20 +59,37 @@ case $dirname in esac if tty -s; then verbose=true; else verbose=false; fi +dry_run=false +trees= # A copy of some stuff from mktex.opt, so we can run in the presence of # terminally damaged ls-R files. -if test "x$1" = x--help || test "x$1" = x-help; then - echo "$usage" - exit 0 -elif test "x$1" = x--version || test "x$1" = x-version; then - echo "`basename $0` $version" - kpsewhich --version - exit 0 -elif test "x$1" = x--verbose || test "x$1" = x-verbose; then - verbose=true +while test $# -gt 0; do + if test "x$1" = x--help || test "x$1" = x-help; then + echo "$usage" + exit 0 + elif test "x$1" = x--version || test "x$1" = x-version; then + echo "`basename $0` $version" + kpsewhich --version + exit 0 + elif test "x$1" = x--verbose || test "x$1" = x-verbose; then + verbose=true + elif test "x$1" = x--dry-run || test "x$1" = x-n; then + dry_run=true + elif test "x$1" = x--quiet || test "x$1" = x--silent \ + || test "x$1" = x-quiet || test "x$1" = x-silent ; then + verbose=false + elif test "x$1" = x--; then + : + elif echo "x$1" | grep '^x-' >/dev/null; then + echo "$progname: unknown option $1, try --help if you need it." >&2 + exit 1 + else + test -d "$1" || echo "$progname: $1 not a directory." >&2 + trees="$trees $1" # don't want to update system dirs + fi shift -fi +done # mktexupd and mktexlsr make sure they're coordinated via this. A copy # is found mktex.opt. @@ -73,16 +97,21 @@ ls_R_magic='% ls-R -- filename database for kpathsea; do not change this line.' # The old string, which should continue to work. old_ls_R_magic='% ls-R -- maintained by MakeTeXls-R; do not change this line.' -trap 'cd / ; test -z "$db_dir_tmp" || rm -rf "$db_dir_tmp"; exit' 0 1 2 3 7 13 15 +trap 'cd /; test -z "$db_dir_tmp" || rm -rf "$db_dir_tmp"; exit' 0 1 2 3 7 13 15 # Get list of directories from $TEXMFDBS; eliminate duplicates. -test $# = 0 && { - OIFS=$IFS - IFS=' +{ + if test -n "$trees"; then + set x $trees + else + OIFS=$IFS # want just a newline + IFS=' ' - set x `kpsewhich --show-path=ls-R | tr : ' -' | sort | uniq`; shift - IFS=$OIFS + set x `kpsewhich --show-path=ls-R | tr : ' +' | sort | uniq` + IFS=$OIFS + fi + shift } for TEXMFLS_R in "$@"; do @@ -92,8 +121,8 @@ for TEXMFLS_R in "$@"; do /* | [A-z]:/*) ;; *) TEXMFLS_R="`pwd`/$TEXMFLS_R" esac - # Allow for ls-R and ls-r to exist. But create ls-R if we're working - # from scratch. + # Allow for either ls-R and ls-r to exist. But create ls-R if we're + # working from scratch. if test -f "$TEXMFLS_R/ls-R"; then db_file="$TEXMFLS_R/ls-R" elif test -f "$TEXMFLS_R/ls-r"; then @@ -111,6 +140,8 @@ for TEXMFLS_R in "$@"; do esac db_dir=`echo "$db_file" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname + # want to be silent if the directory doesn't exist, since the ls-R + # path ordinarily contains many nonexistent directories. test -d "$db_dir" || continue test -w "$db_dir" || { echo "$progname: $db_dir: directory not writable. Skipping..." >&2; continue; } @@ -135,21 +166,24 @@ for TEXMFLS_R in "$@"; do rm -f "$db_file_tmp" $verbose && echo "$progname: Updating $db_file... " >&2 + $dry_run && continue + echo "$ls_R_magic" >"$db_file_tmp" # The main task. We put ./: in the output, so top-level files can be - # found via ls-R. Probably irrelevant in practice. - # The sed command inserts the leading ./ for directory names, and - # removes ., .., and .svn entries from the list. Also omit contents - # of any .svn directories; sed apparently requires that we do that - # operation in a separate invocation. - # We do not try to support colons in directory names. + # found via ls-R. Probably irrelevant in practice. The sed command + # inserts the leading ./ for directory names, and removes ., .., and + # version control entries from the list. Also omit contents of any + # the version directories; sed apparently requires that we do that + # operation in a separate invocation. We do not try to support colons + # in directory names. # echo "./:" >>"$db_file_tmp" + vc_dirs='\.\(bzr\|git\|hg\|svn\)\|CVS\|RCS\|_darcs' (cd "$TEXMFLS_R" && \ls -LRa 2>/dev/null) \ - | sed -e '/^$/{n;s%^\./%%;s%^%./%;}; /^\.$/d; /^\.\.$/d; /^\.svn$/d;' \ - -e '/^[\.\/]*lsR[0-9]*\.tmp:*$/d' \ - | sed -e '/\.svn.*:$/,/^$/d' \ + | sed -e '/^$/{n;s%^\./%%;s%^%./%;}; /^\.$/d; /^\.\.$/d; /^'$vc_dirs'$/d;' \ + -e '/^[\.\/]*lsR[0-9]*\.tmp:*$/d' \ + | sed -e /$vc_dirs'.*:$/,/^$/d' \ >>"$db_file_tmp" # To be really safe, a loop. |