forked from pulp-platform/pulp-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
32 lines (25 loc) · 876 Bytes
/
setup.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
#!/bin/bash -e
add_path() {
export PATH=${PATH//":$1:"/:}
export PATH=${PATH/%":$1"/}
export PATH=${PATH/#"$1:"/}
export PATH="$1${PATH:+":$PATH"}"
}
add_ld_path() {
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH//":$1:"/:}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH/%":$1"/}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH/#"$1:"/}
export LD_LIBRARY_PATH="$1${LD_LIBRARY_PATH:+":$LD_LIBRARY_PATH"}"
}
add_PYTHONPATH() {
export PYTHONPATH=${PYTHONPATH//":$1:"/:}
export PYTHONPATH=${PYTHONPATH/%":$1"/}
export PYTHONPATH=${PYTHONPATH/#"$1:"/}
export PYTHONPATH="$1${PYTHONPATH:+":$PYTHONPATH"}"
}
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
install_dir=$scriptDir/install
add_path $install_dir/ws/bin
add_ld_path $install_dir/ws/lib
add_PYTHONPATH $install_dir/ws/python
export PULP_CONFIGS_PATH=$install_dir/ws/configs