forked from danmar/cppcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaca2-logs2git.sh
More file actions
executable file
·77 lines (50 loc) · 3.57 KB
/
daca2-logs2git.sh
File metadata and controls
executable file
·77 lines (50 loc) · 3.57 KB
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
#!/bin/bash
#just in case...
rm /tmp/daca_msg /tmp/daca_tmp_diff /tmp/daca_tmp_plus /tmp/daca_tmp_minus >& /dev/null
base_url="http://cppcheck.sourceforge.net/devinfo/daca2-report/"
echo ${base_url}daca2.html
for site in `curl -s --compressed ${base_url}daca2.html | grep "^<tr" | grep -o "\".*\"" | sed s/\"//g` ; do
echo ${site} ; curl -s --compressed ${base_url}${site} | sort -n --parallel=4 | sed 's/^ *//; s/ *$//; /^$/d; s/^M$//; s/\r$//' | sed -e 's/\[[0-9][0-9]:[0-9][0-9]\]$//' | sed '/^$/d' | sed 's/\&\;/\&/g; s/</</g; s/>/>/g;' > ${site}
done
curl -s --compressed ${base_url}daca2.html > index.html
git diff > /tmp/daca_tmp_diff
grep "^+.*" /tmp/daca_tmp_diff > /tmp/daca_tmp_plus
grep "^-.*" /tmp/daca_tmp_diff > /tmp/daca_tmp_minus
plus_glob=`wc -l /tmp/daca_tmp_plus | cut -d' ' -f1`
plus_error=`grep -c ":\ \(inconclusive\ \)\?error: " /tmp/daca_tmp_plus`
plus_warning=`grep -c ":\ \(inconclusive\ \)\?warning: " /tmp/daca_tmp_plus`
plus_style=`grep -c ":\ \(inconclusive\ \)\?style: " /tmp/daca_tmp_plus`
plus_performance=`grep -c ":\ \(inconclusive\ \)\?performance: " /tmp/daca_tmp_plus`
plus_portability=`grep -c ":\ \(inconclusive\ \)\?portability: " /tmp/daca_tmp_plus`
#plus_information=`grep -c "]: (information)" /tmp/daca_tmp_plus`
plus_crash=`grep -c "\ Crash?$" /tmp/daca_tmp_plus`
plus_varid=`grep -c "called with varid 0\." /tmp/daca_tmp_plus`
minus_glob=`wc -l /tmp/daca_tmp_minus | cut -d' ' -f1`
minus_error=`grep -c ":\ \(inconclusive\ \)\?error: " /tmp/daca_tmp_minus`
minus_warning=`grep -c ":\ \(inconclusive\ \)\?warning: " /tmp/daca_tmp_minus`
minus_style=`grep -c ":\ \(inconclusive\ \)\?style: " /tmp/daca_tmp_minus`
minus_performance=`grep -c ":\ \(inconclusive\ \)\?performance: " /tmp/daca_tmp_minus`
minus_portability=`grep -c ":\ \(inconclusive\ \)\?portability: " /tmp/daca_tmp_minus`
#minus_information=`grep -c "]: (information)" /tmp/daca_tmp_minus`
minus_crash=`grep -c "\ Crash?$" /tmp/daca_tmp_minus`
minus_varid=`grep -c "called with varid 0\." /tmp/daca_tmp_minus`
files=`git ls-files`
ID_stats=`awk '{ print $NF }' $files | grep "^\[.*\]$" | sort -n | uniq --count | sort -n`
echo "Update `date`" >> /tmp/daca_msg
echo "Updated: `git status --porcelain | grep daca | cut -d' ' -f3 | sed s/daca2-// | sed s/\.html// | tr '\n' ' '`" >> /tmp/daca_msg
echo "all: new: $plus_glob gone: $minus_glob = $((plus_glob-minus_glob))" >> /tmp/daca_msg
echo "error: new: $plus_error gone: $minus_error = $((plus_error-minus_error))" >> /tmp/daca_msg
echo "warning: new: $plus_warning gone: $minus_warning = $((plus_warning-minus_warning))" >> /tmp/daca_msg
echo "style: new: $plus_style gone: $minus_style = $((plus_style-minus_style))" >> /tmp/daca_msg
echo "performance: new: $plus_performance gone: $minus_performance = $((plus_performance-minus_performance))" >> /tmp/daca_msg
echo "portability: new: $plus_portability gone: $minus_portability = $((plus_portability-minus_portability))" >> /tmp/daca_msg
#echo "information: new: $plus_information gone: $minus_information = $((plus_information-minus_information))" >> /tmp/daca_msg
echo "crashes: new: $plus_crash gone: $minus_crash = $((plus_crash-minus_crash))" >> /tmp/daca_msg
echo "varids: new: $plus_varid gone: $minus_varid = $((plus_varid-minus_varid))" >> /tmp/daca_msg
echo "ID stats:" >> /tmp/daca_msg
echo "${ID_stats}" >> /tmp/daca_msg
cat /tmp/daca_msg
git add -A
git commit -F /tmp/daca_msg
rm /tmp/daca_msg /tmp/daca_tmp_diff /tmp/daca_tmp_plus /tmp/daca_tmp_minus
notify-send "daca logs done"