Debian Codegraph @

texk/xdvik/xdvi-sh.in

raw ◀ ▶
1 Debian patch touch this file
1 #!/bin/sh
2
3 # This is the xdvi wrapper script for teTeX, version 0.2.
4 # Copyright Thomas Esser, 1998. Permission to distribute under the terms
5 # of the GNU general public license version 2 or later.
6
7 # This script sets some environment variables to make sure that xdvi's
8 # resource file in $XDVIINPUTS/xdvi is read by xdvi.bin.
9
10 test -f /bin/sh5 && test -z "$RUNNING_SH5" \
11 && test x"`(uname -s) 2>&1`" = xULTRIX \
12 && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; }
13 RUNNING_SH5=
14
15 test -f /bin/bsh && test -z "$RUNNING_BSH" \
16 && test x"`(uname -s) 2>&1`" = xAIX \
17 && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
18 RUNNING_BSH=
19
20 # -help and -version only used to work if they were the only options,
21 # so the "-name xdvi" parameter wasn't used in that case. With current
22 # xdvik, it should work in any case, but we keep this logic for compatibility
23 # with older xdvik and plain xdvi versions.
24 have_basename=`basename foo/bar 2>&1 | grep -i 'not found'`
25 if [ "$have_basename"xxx = "xxx" ]; then
26 BASE_NAME=`basename $0`
27 else
28 BASE_NAME=`echo $0 | sed 's!.*/!!'`
29 fi
30
31 case "$#:$1" in
32 1:-help|1:-version)
33 NAMEOPT=;;
34 *)
35 NAMEOPT="-name $BASE_NAME";;
36 esac
37
38 xdviappfile=`kpsewhich -progname=xdvi --format='other text files' XDvi`
39 if test -n "$xdviappfile"; then
40 xdviappdir=`dirname "$xdviappfile"`
41 xdviapppath="${xdviappdir}/%l_%t/%N:${xdviappdir}/%N"
42
43 # For R3, we have to set XAPPLRESDIR.
44 ### SU: removed, xdvik won't work with R3 anyway, and XAPPLRESDIR is
45 ### for user customizations in current X
46 ### XAPPLRESDIR="$xdviappdir"; export XAPPLRESDIR
47
48 # For R4 or later, we have to set XFILESEARCHPATH, since XAPPLRESDIR might
49 # be ignored (if XUSERFILESEARCHPATH is set)
50 XFILESEARCHPATH="$xdviapppath:${XFILESEARCHPATH-%D}"; export XFILESEARCHPATH
51 fi
52
•53 exec xdvi.bin $NAMEOPT ${1+"$@"}