#!/bin/bash # --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: lib/misc/RegressionsReport.sh # Copyright (C) 2006 - 2008 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- SDE-COPYRIGHT-NOTE-END --- config=default TARGET=regressions revision=`svn info | sed -n 's,^Revision: \(.*\),\1,p'` if [ "$1" = "-cfg" ]; then config="$2"; shift 2 fi eval `grep '^export SDECFG_ID=' config/$config/config` if [ -z "$SDECFG_ID" ]; then echo "Invalid config '$cfg'." exit 1 fi mkdir -p $TARGET echo "[$( date +%T )] Auditing '$config' to '$TARGET/' ..." sh lib/misc/AuditBuild.sh -w $TARGET -cfg $config --no-enabled-too -repository package/* \ | grep '\(CHANGED\|UPDATED\|ADDED\|FAILED\|PENDING\|DISABLED\)' > $TARGET/regressions.$config.$$ echo "[$( date +%T )] Auditing completed." if [ ! -d $TARGET/$config ]; then echo "Something weird happened running AuditBuild.sh. $TARGET/$config was not created." exit 1 fi echo "[$( date +%T )] Rendering report..." { cat < OpenSDE $revision - $( date ) EOT elif [ -f build/$SDECFG_ID/var/adm/logs/$stagelevel-$pkg.log ]; then (( pkgok++ )) fi done < <( grep -e "$pattern$stagelevel.*" config/$config/packages ) pattern="$pattern." done } > $TARGET/regressions.$config.$$-2 cat <
$SDECFG_ID ($revision)
revision:$revision
config: EOT mkdir -p $TARGET/$config/config for x in config/$config/*; do cp $x $TARGET/$config/${x##config/$config/}.txt echo -e "\t\t${x##config/$config/}
" done pkgenabled=$( grep '^X' config/$config/packages | wc -l ) pkgdisabled=$( grep '^O' config/$config/packages | wc -l ) pkgtotal=$( ls -1 package/*/*/*.desc | wc -l ) cat <
Enabled:$pkgenabled
Disabled:$pkgdisabled
Hidden:$( expr $pkgtotal - $pkgenabled - $pkgdisabled )
Total:$pkgtotal

EOT { pattern="^X " pkgtotal=0 pkgerr=0 pkgok=0 for stagelevel in 0 1 2 3 4 5 6 7 8 9; do while read x x x repo pkg x; do (( pkgtotal++ )) if [ -f build/$SDECFG_ID/var/adm/logs/$stagelevel-$pkg.err ]; then (( pkgerr++ )) cat <
$stagelevel$repo/$pkg
Total:$pkgtotal
Built Fine:$pkgok
Broken Builds:$pkgerr
Pending Builds:$( expr $pkgtotal - $pkgok - $pkgerr )

$( cat $TARGET/regressions.$config.$$-2 )
Failed Builds
EOT grep -v DISABLED $TARGET/regressions.$config.$$ cat <
PackageSVN StatusVersionAuditStatus
EOT grep DISABLED $TARGET/regressions.$config.$$ cat <
PackageSVN StatusVersionAuditStatus
EOT } > $TARGET/regressions.$config.html echo "[$( date +%T )] Rendering finished." rm -f $TARGET/regressions.$config.$$ $TARGET/regressions.$config.$$-2 mv -f $TARGET/regressions.$config.html $TARGET/$config/index.html