-
Notifications
You must be signed in to change notification settings - Fork 3
/
rbstats
executable file
·51 lines (46 loc) · 2.52 KB
/
rbstats
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
#!/bin/sh
# sanity check
bad=
for p in * ; do test -e $p/.osc/_files || { echo $p ; bad=1 ; } ; done
[[ $bad ]] && exit 32
exec 3>&1
exec > ~/tmp/rbstats.txt
echo -n "total-packages: "
ls | wc -l
buildtried=$(ls */.osc-build-retval | wc -l)
grep -v '^[02]$' */.osc-build-retval | cut -d/ -f1 > ~/tmp/failed-builds.txt
grep -v '^0$' */.build-differed | cut -d/ -f1 > ~/tmp/differed-builds.txt
grep -v '^0$' */.build-compare-retval | cut -d/ -f1 > ~/tmp/build-compare-differed-builds.txt
grep -v '^0$' */.build-differed-nachbau | cut -d/ -f1 > ~/tmp/differed-builds-nachbau.txt
grep -v '^0$' */.build-compare-retval-nachbau | cut -d/ -f1 > ~/tmp/build-compare-differed-builds-nachbau.txt
buildfailed=$(wc -l < ~/tmp/failed-builds.txt)
buildfailedarch=$(grep "error: Architecture is not included" */.build.log | wc -l)
buildna=$(grep '^[2]$' */.osc-build-retval | wc -l)
buildsucceeded=$(grep '^0$' */.osc-build-retval | wc -l)
echo "build-tried: $buildtried"
echo "build-failed: $((buildfailed-buildfailedarch))"
echo "build-n-a: $((buildna+buildfailedarch))"
echo "build-succeeded: $buildsucceeded"
[[ $((buildfailed+buildna+buildsucceeded)) == $buildtried ]] || { echo sanity check failed ; exit 27; }
#osc prjresults --csv --arch=x86_64 --repo=standard openSUSE:Factory > ~/tmp/oscpr
grep -e ';failed$' -e ';unresolvable$' -e ';disabled$' ~/tmp/oscpr > ~/tmp/oscpr.failed
echo -n "build-official-failed+na: "
wc -l < ~/tmp/oscpr.failed
comparefailed=$(grep -v '^0$' */.build-compare-retval | wc -l)
bitidentical=$(grep '^0$' */.build-differed | wc -l)
echo "build-compare-failed: $comparefailed"
echo "build-compare-succeeded: "$(($buildsucceeded-$comparefailed))
echo "bit-by-bit-identical: $bitidentical" # needs rpm patches
echo "not-bit-by-bit-identical: $(wc -l < ~/tmp/differed-builds.txt)"
echo "not-bit-by-bit-identicalcheck: $((buildsucceeded-bitidentical))"
for p in $(cat ~/tmp/failed-builds.txt) ; do test -d $p && ! cut -d\; -f1 ~/tmp/oscpr.failed | grep -q "^$p$" && ! egrep -q 'Architecture is (excluded|not included)' $p/RPMS/.build.log && ! grep -q "unresolvable: nothing provides " $p/RPMS/.build.log2 && echo $p ; done > ~/tmp/failchecklist 2>/dev/null
exec 1>&3
cat ~/tmp/rbstats.txt
if [[ $final = 1 ]] ; then
cat */RPMS*/checksums > ~/tmp/checksums.txt
for p in * ; do jsonresultcache "$p" ; done
jsonresultmerge * > ~/tmp/reproducible.json
grep . */RPMS/build-time | sort -n -t: -k2 | perl -pe 's{/.*:}{:}' > ~/tmp/build-time.txt
fi
echo "untracked dirs:"
for p in * ; do test -d $p && test -e $p/.osc-build-retval || echo -n "$p " ; done