-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset_sarra.sh
executable file
·48 lines (38 loc) · 1.35 KB
/
set_sarra.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
45
46
47
48
if [ ! "$sarra_py_version" ]; then
if which sr3 >/dev/null; then
sarra_py_version="`sr3 -v| grep -v DEVELOPMENT 2>/dev/null`"
else
sarra_subscribe_binary="`which sr_subscribe`"
if [ ! "${sarra_subscribe_binary}" ]; then
echo "No Sarra python package available. Cannot test."
exit 2
fi
sarra_py_version="`sr_subscribe -h |& awk ' /^version: / { print $2; };'`"
fi
fi
echo "sr python version is: ${sarra_subscribe_binary}, version: ${sarra_py_version} "
#OLDIFS=${IFS}
#IFS=.; read -a sarra_py_version <<<"${sarra_py_version}"
#IFS=${OLDIFS}
if [[ "${sarra_py_version[0]}" < "3" ]]; then
sarra_cpump_binary="`which sr_cpump`"
LGPFX="sr_"
else
sarra_cpump_binary="`which sr3_cpump`"
LGPFX=""
fi
sarra_c_version="`${sarra_cpump_binary} -h |& awk ' /^usage:/ { print $3; };'`"
echo "sr c is: ${sarra_cpump_binary}, PFX=${LGPFX} version: ${sarra_c_version} "
#IFS=.; read -a sarra_c_version <<<"${sarra_c_version}"
#IFS=${OLDIFS}
if [ ! "${SR_DEV_APPNAME}" ]; then
if [[ "${sarra_py_version:0:1}" == "3" ]]; then
export SR_DEV_APPNAME=sr3
else
export SR_DEV_APPNAME=sarra
fi
fi
#echo "appname is: $SR_DEV_APPNAME (used to set conf and cache dirs.)"
#echo "sarra python: $sarra_py_version, c $sarra_c_version"
export sarra_py_version
export sarra_c_version