summaryrefslogtreecommitdiff
path: root/devtools/cov-scan
blob: beb1f0ea1183f56ff7f458dceb7a4bba8f1c5030 (plain)
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
#!/bin/sh
#
# Perform a Coverity self-build on the GPSD code.
# The build tool gets confused if you try to run it direct from scons.
#
# Where the Coverity tools live
PATH=$PATH:/usr/local/coverity/bin
#
# scp destination to drop tarball, can be anywhere web-accessible
DROP_SCP=esr@login.ibiblio.org:/public/html/catb/esr
#
# Public URL for the drop destination
DROP_HTML=http://catb.org/~esr
#
# Things we can deduce
name=`git config core.name`
email=`git config core.email`
#
# Things that are fixed
project=gpsd
password=v2tradeC
prebuild=scons -c
build=scons

# Nothing below this line should require configuration

echo "Rebuilding and scanning..."
$prebuild
rm -fr cov-int
cov-build --dir cov-int $build

echo "Bundling up required metadata..."
cat >/tmp/README <<EOF
Name: $name
Email: $email
Project: $project
EOF
mv cov-int /tmp; 
(cd /tmp; tar -czf project-scan.tgz README cov-int; rm -fr cov-int)

echo "Uploading to where it's publicly visible..." 
scp /tmp/project-scan.tgz $DROP_SCP; rm /tmp/project-scan.tgz

echo "Posting the analysis request..."
# Simulates the form at http://scan.coverity.com/submit.html
curl \
    -d project=$project \
    -d password=$password \
    -d email=$email \
    -d url=$DROP_HTML/project-scan.tgz \
    http://scan5.coverity.com/cgi-bin/submit_build.py

echo "Done. You'll get mail."