~rcr/rirc

ref: d34bdcad32fa9ed0f2b61aa18af88a09a7ea249c rirc/scripts/sa_coverity_get.sh -rwxr-xr-x 704 bytes
d34bdcad — Richard Robbins Merge branch 'dev' into static_analysis 4 months ago
                                                                                
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
#!/bin/bash

set -e

fail() { >&2 printf "%s\n" "$*"; exit 1; }

if [[ -z $1 ]]; then
	fail "Usage: '$0 dir'"
fi

if [[ -z "${COVERITY_TOKEN}" ]]; then
	fail "missing env COVERITY_TOKEN"
fi

DIR="$1"

COVERITY_MD5="$DIR/coverity_tool.md5"
COVERITY_TGZ="$DIR/coverity_tool.tgz"

mkdir -p "$DIR"

echo "*" > "$DIR/.gitignore"

curl -fsS https://scan.coverity.com/download/linux64 -o "$COVERITY_MD5" --data "token=$COVERITY_TOKEN&project=rcr%2Frirc&md5=1"
curl -fsS https://scan.coverity.com/download/linux64 -o "$COVERITY_TGZ" --data "token=$COVERITY_TOKEN&project=rcr%2Frirc"

printf "%s  %s" "$(cat "$COVERITY_MD5")" "$COVERITY_TGZ" | md5sum -c -

tar -xzf "$COVERITY_TGZ" -C "$DIR" --strip-components 1