-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup_eco_env.sh
executable file
·45 lines (41 loc) · 1.75 KB
/
setup_eco_env.sh
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
#!/bin/bash
# This file is intended to be sourced by eco_tools launchers to
# setupt the minimum env for common eco_tools.
#
# For gitRecommitBranch.py and other migration tools, use add-to-env.sh
# instead of this script.
#
if [ ! -z "`echo $0 | fgrep setup_eco_env.sh`" ]; then
echo "Usage: source path/to/eco_tools/setup_eco_env.sh"
exit 1
fi
# Make sure we have a canonical path to eco_tools
this_script=`readlink -f ${BASH_SOURCE[0]}`
eco_tools_dir=`readlink -f $(dirname $this_script)`
# Make sure we have PSPKG_ROOT and TOOLS_SITE_TOP
# Use CONFIG_SITE_TOP to locate common_dirs.sh or
# check known facility paths.
if [ -z "$PSPKG_ROOT" -o -z "$TOOLS_SITE_TOP" ]; then
if [ ! -z "$CONFIG_SITE_TOP" -a -f $CONFIG_SITE_TOP/common_dirs.sh ]; then
source $CONFIG_SITE_TOP/common_dirs.sh
elif [ -f $FACILITY_ROOT/epics/config/common_dirs.sh ]; then
source $FACILITY_ROOT/epics/config/common_dirs.sh
elif [ -f /usr/local/lcls/epics/config/common_dirs.sh ]; then
source /usr/local/lcls/epics/config/common_dirs.sh
elif [ -f /usr/local/facet/epics/config/common_dirs.sh ]; then
source /usr/local/facet/epics/config/common_dirs.sh
elif [ -f /usr/local/controls/config/common_dirs.sh ]; then
source /usr/local/controls/config/common_dirs.sh
elif [ -f /reg/g/pcds/pyps/config/common_dirs.sh ]; then
source /reg/g/pcds/pyps/config/common_dirs.sh
elif [ -f /afs/slac/g/lcls/epics/config/common_dirs.sh ]; then
source /afs/slac/g/lcls/epics/config/common_dirs.sh
elif [ -f /afs/slac/g/pcds/config/common_dirs.sh ]; then
source /afs/slac/g/pcds/config/common_dirs.sh
fi
fi
# Add the git-utils-0.2.0 pkg_mgr release for python/2.7.5
export PSPKG_RELEASE=git-utils-0.2.0
if [ -d "$PSPKG_ROOT/release/$PSPKG_RELEASE" ]; then
source $PSPKG_ROOT/etc/set_env.sh
fi