2 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # Filename: lib/misc/RegressionsReport.sh
6 # Copyright (C) 2006 - 2008 The OpenSDE Project
7 # Copyright (C) 2004 - 2006 The T2 SDE Project
9 # More information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; version 2 of the License. A copy of the
14 # GNU General Public License can be found in the file COPYING.
15 # --- SDE-COPYRIGHT-NOTE-END ---
18 revision
=`svn info | sed -n 's,^Revision: \(.*\),\1,p'`
20 if [ "$1" == "-cfg" ]; then
24 eval `grep '^export SDECFG_ID=' config/$config/config`
26 if [ -z "$SDECFG_ID" ]; then
27 echo "Invalid config '$cfg'."
33 echo "[$( date +%T )] Auditing '$config' to '$TARGET/' ..."
34 sh lib
/misc
/AuditBuild.sh
-w $TARGET -cfg $config --no-enabled-too -repository package
/* \
35 |
grep '\(CHANGED\|UPDATED\|ADDED\|FAILED\|PENDING\|DISABLED\)' > $TARGET/regressions.
$config.$$
36 echo "[$( date +%T )] Auditing completed."
38 if [ ! -d $TARGET/$config ]; then
39 echo "Something weird happened running AuditBuild.sh. $TARGET/$config was not created."
43 echo "[$( date +%T )] Rendering report..."
48 <head><title>OpenSDE $revision - $( date )</title></head>
51 <tr><th colspan="2">$SDECFG_ID ($revision)</th></tr>
53 <table border="1" cellspacing="0" width="100%">
54 <tr><td>revision</td><td>:</td><td>$revision</td></tr>
55 <tr><td>config</td><td>:</td><td>
58 mkdir
-p $TARGET/$config/config
59 for x
in config
/$config/*; do
60 cp $x $TARGET/$config/${x##config/$config/}.txt
61 echo -e "\t\t<a href=\"${x##config/$config/}.txt\">${x##config/$config/}</a><br />"
64 pkgenabled
=$
( grep '^X' config
/$config/packages |
wc -l )
65 pkgdisabled
=$
( grep '^O' config
/$config/packages |
wc -l )
66 pkgtotal
=$
( ls -1 package
/*/*/*.desc |
wc -l )
69 <tr><td>Enabled</td><td>:</td><td>$pkgenabled</td></tr>
70 <tr><td>Disabled</td><td>:</td><td>$pkgdisabled</td></tr>
71 <tr><td>Hidden</td><td>:</td><td>$( expr $pkgtotal - $pkgenabled - $pkgdisabled )</td></tr>
72 <tr><td>Total</td><td>:</td><td>$pkgtotal</td></tr>
79 pkgtotal
=0 pkgerr
=0 pkgok
=0
80 for stagelevel
in 0 1 2 3 4 5 6 7 8 9; do
81 while read x x x repo pkg x
; do
83 if [ -f build
/$SDECFG_ID/var
/adm
/logs
/$stagelevel-$pkg.err
]; then
86 <tr><td>$stagelevel</td><td><a href="log/$stagelevel-$pkg.err.txt">$repo/$pkg</a></td></tr>
88 elif [ -f build
/$SDECFG_ID/var
/adm
/logs
/$stagelevel-$pkg.log
]; then
91 done < <( grep -e "$pattern$stagelevel.*" config
/$config/packages
)
94 } > $TARGET/regressions.
$config.$$
-2
97 <table border="1" cellspacing="0" width="100%">
98 <tr><td>Total</td><td>:</td><td align="right">$pkgtotal</td></tr>
99 <tr><td>Built Fine</td><td>:</td><td align="right">$pkgok</td></tr>
100 <tr><td>Broken Builds</td><td>:</td><td align="right">$pkgerr</td></tr>
101 <tr><td>Pending Builds</td><td>:</td><td align="right">$( expr $pkgtotal - $pkgok - $pkgerr )</td></tr>
104 <table border="1" cellspacing="0" width="100%">
105 <tr><th colspan="2">Failed Builds</th></tr>
106 $( cat $TARGET/regressions.$config.$$-2 )
110 <tr><th>Package</th><th>SVN Status</th><th>Version</th><th>Audit</th><th>Status</th></tr>
113 grep -v DISABLED
$TARGET/regressions.
$config.$$
117 <tr><th>Package</th><th>SVN Status</th><th>Version</th><th>Audit</th><th>Status</th></tr>
120 grep DISABLED
$TARGET/regressions.
$config.$$
127 } > $TARGET/regressions.
$config.html
129 echo "[$( date +%T )] Rendering finished."
131 rm -f $TARGET/regressions.
$config.$$
$TARGET/regressions.
$config.$$
-2
132 mv -f $TARGET/regressions.
$config.html
$TARGET/$config/index.html