source: branches/port5/SH/arb

Last change on this file was 7486, checked in by westram, 14 years ago

based on a patch from Andreas Tille (thank you)

  • removed textedit relicts
  • removed some ancient scripts
  • arb_textedit
    • separates between X- and non-X-editors (and prefer X-editors)
    • added 'editor' with low priority (not neccessarily uses X, may point to nano which fails in xterm)
    • start Xterm (ARB_XCMD) to run non-X-editors (did not edit anything at all when a non-X-editor was selected)
  • removed default configs
    • instead in 'SH/arb'
      • set ARB_XTERM
      • set ARB_XCMD to '$ARB_XTERM -e'
      • no longer overwrite ARB_TEXTEDIT and ARB_GS
  • replaced ARB_TEXTEDIT in GDEmenus (file is obsolete, but i wont clean it up in stable)
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1#!/bin/bash
2
3nargs=$#
4args="$*"
5
6# error message function
7err () {
8        echo "`basename $0`: $@" 1>&2
9        exit 1
10}
11
12# Add to the path variable named by $1 the component $2.  $3 must be
13# "append" or "prepend" to indicate where the component is added.
14
15addpath () {
16    eval value=\"\$$1\"
17    case "$value" in
18        *:$2:*|*:$2|$2:*|$2)
19            result="$value"
20            ;;
21        "")
22            result="$2"
23            ;;
24        *)
25            case "$3" in
26                p*)
27                    result="$2:${value}"
28                    ;;
29                *)
30                    result="${value}:$2"
31                    ;;
32            esac
33    esac
34    eval $1=$result
35    unset result value
36}
37
38# convenience routine which appends a string to a path.
39append () {
40    addpath "$1" "$2" append
41}
42
43# convenience routine which prepends a string to a path.
44prepend () {
45    addpath "$1" "$2" prepend
46}
47
48
49case "X${ARBHOME}" in
50  X)
51        if [ -x /usr/arb/bin/arb ];then
52                ARB=/usr/arb/bin/arb
53        else
54              case "$0" in
55                /*)
56                       ARB="$0";;
57                *)
58                     if ARB=`which $0`; then
59                       echo $ARB
60                     else
61                       ARB=`pwd`/$0
62                     fi;;
63              esac
64        fi
65
66        ARBBIN=`dirname $ARB`
67        export ARBBIN
68        ARBHOME=`dirname $ARBBIN`
69        export ARBHOME
70        echo "Environment Variable ARBHOME was empty"
71esac
72
73echo "Using ARBHOME='$ARBHOME'"
74
75prepend PATH                    $ARBHOME/bin
76prepend LD_LIBRARY_PATH         $ARBHOME/lib
77append  LD_LIBRARY_PATH         /usr/dt/lib
78append  LD_LIBRARY_PATH         /usr/openwin/lib
79append  LD_LIBRARY_PATH         $ARBHOME/lib/addlibs
80prepend SHLIB_PATH              $ARBHOME/lib
81append  SHLIB_PATH              $ARBHOME/lib/addlibs
82
83# environment variables that this shell script sets/changes:
84export LD_LIBRARY_PATH MANPATH PATH ARBHOME SHLIB_PATH
85
86# global envs:
87
88export PWD HOME USER
89
90if [ -x $ARBHOME/bin/ghostview ] ; then
91  GS_LIB="$ARBHOME/DEPOT/ghostscript"
92  export GS_LIB
93fi
94
95ARB_PID="$$"; export ARB_PID
96
97ARB_PROPERTIES=${HOME}/.arb_prop
98
99if [ ! -d ${ARB_PROPERTIES} ] ; then
100  echo "Directory ${ARB_PROPERTIES} not found - creating ..."
101  mkdir ${ARB_PROPERTIES}
102fi
103
104if [ "X$ARBMACROHOME" = "X" ] ; then
105  ARBMACROHOME="${ARB_PROPERTIES}/macros";
106  export ARBMACROHOME
107fi
108if [ ! -d ${ARBMACROHOME} ] ; then
109  echo "Directory $ARBMACROHOME not found - creating ..."
110  mkdir ${ARBMACROHOME}
111fi
112
113if [ "X$ARBMACRO" = "X" ] ; then
114  ARBMACRO="$ARBHOME/lib/macros"
115  export ARBMACRO
116fi
117if [ ! -d ${ARBMACRO} ] ; then
118  echo "Directory $ARBMACRO not found - creating ..."
119  mkdir ${ARBMACRO}
120fi
121
122if [ "X$GDE_HELP_DIR" = "X" ] ; then
123  GDE_HELP_DIR="$ARBHOME/GDEHELP"
124  export GDE_HELP_DIR
125fi
126
127# set default command-tool used by ARB
128ARB_XTERM=${ARB_XTERM:-xterm -sl 1000 -sb -geometry 120x50}
129export ARB_XTERM
130ARB_XCMD=${ARB_XCMD:-$ARB_XTERM -e}
131export ARB_XCMD
132
133# save LD_LIBRARY_PATH
134ARB_LIBRARY_PATH="${LD_LIBRARY_PATH}"
135export ARB_LIBRARY_PATH
136
137if [ "$args" = "shell" ]; then
138    echo "Opening an ARB shell"
139    sh
140else   
141    if [ "$1" = "trace" ]; then
142        shift
143        $ARBHOME/SH/arb_trace $*
144    else
145        echo "Please wait while the program ARB is starting ....."
146        (arb_ntree $args;arb_clean >/dev/null 2>&1;echo ARB done) &
147    fi
148fi
149
Note: See TracBrowser for help on using the repository browser.