-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstarlab_start.sh.in
83 lines (73 loc) · 2.96 KB
/
starlab_start.sh.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# DO NOT EDIT THIS FILE as 'starlab_start.sh' -- generated by configure.
# Source this file from your .profile file to set up the following environment
# variables:
#
# STARLAB_PATH Root directory of the Starlab source distribution.
# Used by many scripts in sbin, but nowhere else in
# the Starlab make process or by any Starlab program.
# Could easily be removed, as all the Starlab scripts
# could be autoconfigured. However, retain for
# compatibility with older setup and other scripts.
#
# STARLAB_INSTALL_PATH Directory in which the Starlab bin, include,
# info, lib, man, and share directories are
# installed. Necessary for running and
# linking with the Starlab software, but
# not used within Starlab itself.
#
# STARLAB A ~convenient synonym for STARLAB_PATH, again never
# used within Starlab, but retained for compatibility.
#
# STARLAB_VERSION The current Starlab version number, derived from the
# "definitive" version in autoconf.ac. Not used by
# Starlab, but retained for compatibility with older
# scripts and other programs.
#
# STARLAB_PATH and STARLAB_INSTALL_PATH are then used to update the search path.
#
#---------------------------------------------------------------------
# NOTE that by hard-wiring the paths, this script will not work properly
# if Starlab is moved after installation. See starlab_start.csh for how
# to correct this (not yet implemented here...)
old_path=""
if [ "x$STARLAB_PATH" != "x" ]; then
old_path=$STARLAB_PATH
fi
export STARLAB_PATH="@STARLAB_SOURCE_PATH@"
export STARLAB_INSTALL_PATH="@STARLAB_INSTALL_PATH@"
export STARLAB=$STARLAB_PATH
if [ "x$STARLAB_PATH" != "x$old_path" && "x$TERM" != "x" ]; then
echo STARLAB_PATH changed to $STARLAB_PATH
fi
unset old_path
# Bash users are tough enough not to have a VERSION file created for
# them if none already exists...
if [ -e $STARLAB_PATH/VERSION ]; then
export STARLAB_VERSION=`cat $STARLAB_PATH/VERSION`
fi
if [ "x$TERM" != "x" ]; then
echo "Starlab version $STARLAB_VERSION loaded with"
echo " STARLAB_PATH = $STARLAB_PATH"
echo " STARLAB_INSTALL_PATH = $STARLAB_INSTALL_PATH"
fi
#---------------------------------------------------------------------
#
# Remove any old Starlab from the search path,
# but leave "/sbin", "/usr/sbin", "/usr/local/sbin" intact.
# Add Starlab to search path after the first appearance of . or .. (or
# at start of path if absent).
#
# *** CHECK: what if we are user starlab and have a ~/bin directory??? ***
# *** TO DO -- NOT TESTED (Steve, 9/04) ***
PATH=`echo "$PATH" | tr : '\12' | \
awk '! /starlab.*bin$/ || /^(\/(|usr|local))+\/sbin$/ { p[++n] = $0; }
/^\.+$/ { if (firstdot == 0) firstdot = n; }
END {
if(firstdot == 0)
printf "%s", ".:" spath1 ":" spath2 ;
else
p[firstdot] = p[firstdot] ":" spath1 ":" spath2 ;
printf "%s", p[1];
for (i=2; i<=n; i++) printf ":%s", p[i];
}' spath1=$STARLAB_PATH/sbin spath2=$STARLAB_INSTALL_PATH/bin`
export PATH