-
Notifications
You must be signed in to change notification settings - Fork 23
/
init.sh
executable file
·93 lines (73 loc) · 2.8 KB
/
init.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
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
84
85
86
87
88
89
90
91
92
93
# from https://askubuntu.com/questions/916976/bash-one-liner-to-check-if-version-is
version_checker() {
local ver1=$1
while [ `echo $ver1 | egrep -c [^0123456789.]` -gt 0 ]; do
char=`echo $ver1 | sed 's/.*\([^0123456789.]\).*/\1/'`
char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`
ver1=`echo $ver1 | sed "s/$char/.$char_dec/g"`
done
local ver2=$2
while [ `echo $ver2 | egrep -c [^0123456789.]` -gt 0 ]; do
char=`echo $ver2 | sed 's/.*\([^0123456789.]\).*/\1/'`
char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`
ver2=`echo $ver2 | sed "s/$char/.$char_dec/g"`
done
ver1=`echo $ver1 | sed 's/\.\./.0/g'`
ver2=`echo $ver2 | sed 's/\.\./.0/g'`
do_version_check "$ver1" "$ver2"
}
do_version_check() {
[ "$1" == "$2" ] && return 10
ver1front=`echo $1 | cut -d "." -f -1`
ver1back=`echo $1 | cut -d "." -f 2-`
ver2front=`echo $2 | cut -d "." -f -1`
ver2back=`echo $2 | cut -d "." -f 2-`
if [ "$ver1front" != "$1" ] || [ "$ver2front" != "$2" ]; then
[ "$ver1front" -gt "$ver2front" ] && return 11
[ "$ver1front" -lt "$ver2front" ] && return 9
[ "$ver1front" == "$1" ] || [ -z "$ver1back" ] && ver1back=0
[ "$ver2front" == "$2" ] || [ -z "$ver2back" ] && ver2back=0
do_version_check "$ver1back" "$ver2back"
return $?
else
[ "$1" -gt "$2" ] && return 11 || return 9
fi
}
perl_version=`perl -e 'print $];'`
do_version_check "$perl_version" "5.0.10"
[[ $? -eq 9 ]] && echo "[Error] Perl version >= 5.0.10" && exit 1 ;
which wget > /dev/null
[[ $? -eq 1 ]] && echo "[Error] wget not installed" && exit 1 ;
#do_version_check "`svn --version --quiet`" "1.8"
#[[ $? -eq 9 ]] && echo "[Error] snv version >= 1.8" && exit 1 ;
#version_checker "`git version | sed "s/git version //"`" "1.9"
#[[ $? -eq 9 ]] && echo "[Error] git version >= 1.9" && exit 1 ;
which gradle > /dev/null
[[ $? -eq 1 ]] && echo "[Error] gradle not installed" && exit 1 ;
which time > /dev/null
[[ $? -eq 1 ]] && echo "[Error] time not installed" && exit 1 ;
which mvn > /dev/null
[[ $? -eq 1 ]] && echo "[Error] maven not installed" && exit 1 ;
if ! perl -MDBI -e 1 2>/dev/null;then echo "[Error] Perl DBI not installed (perl -MCPAN -e 'install DBI')" && exit 1 ; fi
git submodule init;
git submodule update;
cd benchmarks/Bug-dot-jar/;
git submodule init;
git submodule update;
cd ../defects4j;
./init.sh
cd ../../
git clone https://github.com/tdurieux/project-info-maven-plugin
cd project-info-maven-plugin
mvn -Dhttps.protocols=TLSv1.2 install -DskipTests
cd ..
rm -rf project-info-maven-plugin
if [ ! -d libs/z3 ]; then
cd libs/z3
mkdir -p ../z3_bin
python scripts/mk_make.py --java --prefix=../z3_bin
cd build
make
#make install
cd ../../
fi