]> git.donarmstrong.com Git - cran2deb.git/blob - branch/multisys/exec/diagnose
multisys: support for multiple os-arch configurations (preliminary)
[cran2deb.git] / branch / multisys / exec / diagnose
1 #!/usr/bin/rc
2
3 success=`{ls /var/cache/cran2deb/results/*.deb | wc -l}
4 echo $success successful packages
5 total=$success
6
7 fn count_dup { sort | uniq -c | sort -n}# | awk '$1 > 1{print}' }
8 fn collapse { a=`{echo $^* | sed -e 's/ | /|/g'}; echo $^a }
9 echo 'warnings:'
10 {for (x in (warn/* /dev/null)) cut -d: -f3- <$x | sort -u} | awk '{print $1}' | count_dup
11 echo
12
13 faildep=('^Error: package ''.*'' could not be loaded'
14      '|' '^ERROR: lazy loading failed for package ''.*'''
15      '|' '^[[:space:]]*package .* is not available'
16      '|' 'there is no package called ''.*''')
17 faildeb='do not know what to do with SystemRequirement:'
18 faillic=('No acceptable license: ')
19 failspc=': No space left on device'
20 failhdr='error: .*\.hp?p?: No such file or directory'
21 faildep=`{collapse $faildep}
22 faildep=$^faildep
23 faillic=`{collapse $faillic}
24 faillic=$^faillic
25 other=''
26
27 nfaildep=`{grep -El $faildep fail/* /dev/null | wc -l}
28 echo $nfaildep failed R dependencies.
29 grep -Eh $faildep fail/* | count_dup
30 other=$faildep
31 #total=$total+$nfaildep
32 echo
33
34 nfaillic=`{grep -El $faillic `{grep -EL $other fail/*} /dev/null | wc -l}
35 echo $nfaillic failed licenses.
36 grep -Eh $faillic `{grep -EL $other fail/*} | count_dup
37 other=$other^'|'^$faillic
38 total=$total+$nfaillic
39 echo
40
41 nfailspc=`{grep -El $failspc `{grep -EL $other fail/*} /dev/null | wc -l}
42 echo $nfailspc out of space
43 other=$other^'|'^$failspc
44 total=$total+$nfailspc
45 echo
46
47 nfailhdr=`{grep -El $failhdr `{grep -EL $other fail/*} /dev/null | wc -l}
48 echo $nfailhdr missing C header
49 grep -Eh $failhdr `{grep -EL $other fail/* /dev/null} | count_dup
50 other=$other^'|'^$failhdr
51 total=$total+$nfailhdr
52 echo
53
54 nfaildeb=`{grep -El $faildeb `{grep -EL $other fail/*} /dev/null | wc -l}
55 echo $nfaildeb system requirement failures.
56 grep -Eh $faildeb `{grep -EL $other fail/* /dev/null} | count_dup
57 other=$other^'|'^$faildeb
58 total=$total+$nfaildeb
59 echo
60
61 nfailother=`{hoc -e `{grep -EL $other fail/* /dev/null | wc -l}^-1}
62 echo $nfailother other failures.
63
64 total=`{hoc -e $total}
65 succrate=`{hoc -e $success/'('$total')*100'}
66 echo $succrate% success rate '('$total' total)'
67 #total=`{hoc -e $total-$nfaillic-$nfailspc-$nfailhdr}
68 total=`{hoc -e $total-$nfaillic-$nfailspc}
69 succrate=`{hoc -e $success/'('$total')*100'}
70 echo $succrate% success rate with exclusions '('$total' total)'
71 grep -EL $other fail/* /dev/null | xargs tail -n 20
72