summaryrefslogtreecommitdiff
path: root/devtools/cov-scan
blob: 587a92115e65d9e2e8c42c7fb8d0a3725793377f (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
54
55
56
57
#!/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 user.name`
email=`git config user.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
url=$DROP_HTML/project-scan.tgz

echo "Post $url to http://scan.coverity.com/submit.html"

: echo "Posting the analysis request..."
# Simulates the form at http://scan.coverity.com/submit.html
# Sadly, this doesn't work yet - probably needs login context
: curl \
    -d project=$project \
    -d password=$password \
    -d email=$email \
    -d url=$url \
    http://scan5.coverity.com/cgi-bin/submit_build.py
: echo "Done. You'll get mail."