-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.sh
executable file
·132 lines (104 loc) · 2.47 KB
/
configure.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/env bash
echo "Configuring repo. I hope you use Ubuntu..."
set -x
set -e
############
# Functions
############
function installWine {
if command_exists wine ; then
echo "wine already installed"
return
fi
echo "Installing wine -- sudo required"
# https://tecadmin.net/install-wine-on-ubuntu/
sudo dpkg --add-architecture i386
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'
sudo apt-get update
sudo apt-get install --install-recommends winehq-stable
if command_exists wine ; then
echo "wine successfully installed"
return
fi
echo "Could not install wine"
exit 1
}
function installNVM {
if command_exists nvm ; then
echo "nvm already installed"
return
fi
echo "Installing nvm"
# TODO My notes say we need this for the vuln-regex-detector installation. Do we?
echo "Installing nvm"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
# Source so nvm is in path now
touch ~/.bashrc && . ~/.bashrc
}
function command_exists {
type "$1" &> /dev/null ;
}
############
# Configuration
############
#####
# corpus/
echo "Configuring corpus creation tools"
pushd corpus/corpus-creation/
echo " Tools for extraction via static analysis"
pushd static-analysis/
pushd java/regex-extractor
./build.pl
popd
pushd js
./build.pl
popd
pushd ts
./build.pl
popd
pushd python
./build.pl
popd
popd
echo " Tools for extraction via program instrumentation"
pushd program-instrumentation
pushd run/
./build.pl
popd
popd
popd
#####
# measurement-instruments/
echo "Configuring regex measurement tools"
echo "Installing nvm (for vuln-regex-detector)"
installNVM
echo "Installing wine (so we can run AutomataCLI.exe)"
installWine
pushd measurement-instruments/
./build.pl
echo " Configuring worst-case performance detection"
pushd worst-case-performance/
./build.pl
popd
popd
#####
# regex corpuses
echo "Unpacking regex corpuses"
pushd corpus/
pushd Davis2019-RegexGeneralizability-MultiMethodCorpus/
./unpack.pl
popd
popd
pushd measured-corpuses/
pushd Wang2018-RegexTestingCoverage/
./unpack.pl
popd
pushd Davis2019-LinguaFranca-ManyLanguageCorpus/
./unpack.pl
popd
pushd Davis2019-RegexGeneralizability-MultiMethodCorpus/
./unpack.pl
popd
popd
echo "Configuration complete. I hope everything works!"