-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_checks.sh
executable file
·49 lines (49 loc) · 1.79 KB
/
run_checks.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
49
#!/bin/bash
file_size_kb=0
if [[ ! -f genomicsdb-${GENOMICSDB_VERSION}-allinone-spark.jar && ! -f genomicsdb-${GENOMICSDB_VERSION}-allinone.jar ]]; then
echo "Could not find genomicsdb-${GENOMICSDB_VERSION}-allinone-spark.jar or genomicsdb-${GENOMICSDB_VERSION}-allinone-spark.jar"
exit 1
fi
if [[ -f genomicsdb-${GENOMICSDB_VERSION}-allinone-spark.jar ]]; then
file_size_kb=`du -k genomicsdb-${GENOMICSDB_VERSION}-allinone-spark.jar | cut -f1`
else
file_size_kb=`du -k genomicsdb-${GENOMICSDB_VERSION}-allinone.jar | cut -f1`
fi
if [[ ! -f genomicsdb-${GENOMICSDB_VERSION}.jar ]]; then
echo "Could not find genomicsdb-${GENOMICSDB_VERSION}.jar"
exit 1
fi
if [ $file_size_kb == 0 ]; then
echo "genomicsdb-${GENOMICSDB_VERSION}-allinone-spark.jar or genomicsdb-${GENOMICSDB_VERSION}-allinone.jar has no contents"
exit 1
fi
file_size_kb=`du -k genomicsdb-${GENOMICSDB_VERSION}.jar | cut -f1`
if [ $file_size_kb == 0 ]; then
echo "genomicsdb-${GENOMICSDB_VERSION}.jar has no contents"
exit 1
fi
osname=`uname -s`
if [ "$osname" == "Linux" ]; then
LIBRARY_SUFFIX=so
jar xvf genomicsdb-${GENOMICSDB_VERSION}.jar libtiledbgenomicsdb.${LIBRARY_SUFFIX}
if [[ -f libtiledbgenomicsdb.${LIBRARY_SUFFIX} ]]; then
ldd libtiledbgenomicsdb.${LIBRARY_SUFFIX}
md5sum libtiledbgenomicsdb.${LIBRARY_SUFFIX}
else
echo "Could not find libtiledbgenomicsdb.${LIBRARY_SUFFIX}"
exit 1
fi
elif [ "$osname" == "Darwin" ]; then
LIBRARY_SUFFIX=dylib
jar xvf genomicsdb-${GENOMICSDB_VERSION}.jar libtiledbgenomicsdb.${LIBRARY_SUFFIX}
if [[ -f libtiledbgenomicsdb.${LIBRARY_SUFFIX} ]]; then
otool -L libtiledbgenomicsdb.${LIBRARY_SUFFIX}
md5 -r libtiledbgenomicsdb.${LIBRARY_SUFFIX}
else
echo "Could not find libtiledbgenomicsdb.${LIBRARY_SUFFIX}"
exit 1
fi
else
echo "Platform $osname is not supported"
exit 1
fi