~ubuntu-branches/debian/experimental/qrouter/experimental

« back to all changes in this revision

Viewing changes to .pc/02_use_tkcon_from_debian.patch/qrouter.sh.in

  • Committer: Package Import Robot
  • Author(s): Ruben Undheim
  • Date: 2014-09-21 12:29:19 UTC
  • Revision ID: package-import@ubuntu.com-20140921122919-vvfkqqmty8bicncs
Tags: 1.3.1-1
Initial release (Closes: #760629)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# For installation, put this file (qrouter.sh) in a standard executable path.
 
4
# Put startup script "qrouter.tcl" and shared library "qrouter.so"
 
5
# in ${QROUTER_LIB_DIR}.
 
6
#
 
7
# This script starts qrouter under the Tcl interpreter,
 
8
# reading commands from script qrouter.tcl which launches qrouter
 
9
# and retains the Tcl interactive interpreter.
 
10
 
 
11
# Parse for the argument "-noc[onsole]".  If it exists, run qrouter
 
12
# without the TkCon console.  Strip this argument from the argument list.
 
13
 
 
14
loclibdir=${QROUTER_LIB_DIR:=LIBDIR}
 
15
export QROUTER_LIB_DIR
 
16
QROUTER_WISH=WISH_EXE
 
17
export QROUTER_WISH
 
18
 
 
19
# Hacks for Cygwin
 
20
if [ ${TERM:=""} = "cygwin" ]; then
 
21
   export PATH="$PATH:$loclibdir"
 
22
   export DISPLAY=${DISPLAY:=":0"}
 
23
fi
 
24
 
 
25
# Don't use the console if "-noc[onsole]" was specified.
 
26
# Also, if "-i", "-h", or "-c" is specified, then this is
 
27
# a batch-mode operation and the console should be ignored.
 
28
TKCON=true
 
29
for i in $@ ; do
 
30
   case $i in
 
31
      -noc*)
 
32
        TKCON=
 
33
        shift
 
34
        ;;
 
35
      -i* | -h* | -c* )
 
36
        TKCON=
 
37
        ;;
 
38
   esac
 
39
done
 
40
 
 
41
if [ $TKCON ]; then
 
42
 
 
43
   exec ${loclibdir}/tkcon.tcl \
 
44
        -eval "source ${loclibdir}/console.tcl" \
 
45
        -slave "package require Tk; set argc $#; set argv [list $*]; \
 
46
        source ${loclibdir}/qrouter.tcl"
 
47
else
 
48
 
 
49
#
 
50
# Run the stand-in for wish (qrouterexec), which acts exactly like "wish"
 
51
# except that it replaces ~/.wishrc with qrouter.tcl.  This executable is
 
52
# *only* needed when running without the console; the console itself is
 
53
# capable of sourcing the startup script.
 
54
#
 
55
   exec ${loclibdir}/qrouterexec -- $@
 
56
 
 
57
fi