head	1.1;
branch	1.1.1;
access;
symbols
	RELENG_9_1_0_RELEASE:1.1.1.2
	RELENG_9_1:1.1.1.2.0.52
	RELENG_9_1_BP:1.1.1.2
	RELENG_8_3_0_RELEASE:1.1.1.2
	RELENG_8_3:1.1.1.2.0.50
	RELENG_8_3_BP:1.1.1.2
	RELENG_9_0_0_RELEASE:1.1.1.2
	RELENG_9_0:1.1.1.2.0.48
	RELENG_9_0_BP:1.1.1.2
	RELENG_9:1.1.1.2.0.46
	RELENG_9_BP:1.1.1.2
	RELENG_7_4_0_RELEASE:1.1.1.2
	RELENG_8_2_0_RELEASE:1.1.1.2
	RELENG_7_4:1.1.1.2.0.44
	RELENG_7_4_BP:1.1.1.2
	RELENG_8_2:1.1.1.2.0.42
	RELENG_8_2_BP:1.1.1.2
	RELENG_8_1_0_RELEASE:1.1.1.2
	RELENG_8_1:1.1.1.2.0.40
	RELENG_8_1_BP:1.1.1.2
	RELENG_7_3_0_RELEASE:1.1.1.2
	RELENG_7_3:1.1.1.2.0.38
	RELENG_7_3_BP:1.1.1.2
	RELENG_8_0_0_RELEASE:1.1.1.2
	RELENG_8_0:1.1.1.2.0.36
	RELENG_8_0_BP:1.1.1.2
	RELENG_8:1.1.1.2.0.34
	RELENG_8_BP:1.1.1.2
	RELENG_7_2_0_RELEASE:1.1.1.2
	RELENG_7_2:1.1.1.2.0.32
	RELENG_7_2_BP:1.1.1.2
	RELENG_7_1_0_RELEASE:1.1.1.2
	RELENG_6_4_0_RELEASE:1.1.1.2
	RELENG_7_1:1.1.1.2.0.30
	RELENG_7_1_BP:1.1.1.2
	RELENG_6_4:1.1.1.2.0.28
	RELENG_6_4_BP:1.1.1.2
	RELENG_7_0_0_RELEASE:1.1.1.2
	RELENG_6_3_0_RELEASE:1.1.1.2
	RELENG_7_0:1.1.1.2.0.26
	RELENG_7_0_BP:1.1.1.2
	RELENG_6_3:1.1.1.2.0.24
	RELENG_6_3_BP:1.1.1.2
	RELENG_7:1.1.1.2.0.22
	RELENG_7_BP:1.1.1.2
	RELENG_6_2_0_RELEASE:1.1.1.2
	RELENG_6_2:1.1.1.2.0.20
	RELENG_6_2_BP:1.1.1.2
	RELENG_5_5_0_RELEASE:1.1.1.2
	RELENG_5_5:1.1.1.2.0.18
	RELENG_5_5_BP:1.1.1.2
	RELENG_6_1_0_RELEASE:1.1.1.2
	RELENG_6_1:1.1.1.2.0.16
	RELENG_6_1_BP:1.1.1.2
	RELENG_6_0_0_RELEASE:1.1.1.2
	RELENG_6_0:1.1.1.2.0.14
	RELENG_6_0_BP:1.1.1.2
	RELENG_6:1.1.1.2.0.12
	RELENG_6_BP:1.1.1.2
	RELENG_5_4_0_RELEASE:1.1.1.2
	RELENG_5_4:1.1.1.2.0.10
	RELENG_5_4_BP:1.1.1.2
	RELENG_5_3_0_RELEASE:1.1.1.2
	RELENG_5_3:1.1.1.2.0.8
	RELENG_5_3_BP:1.1.1.2
	RELENG_5:1.1.1.2.0.6
	RELENG_5_BP:1.1.1.2
	RELENG_5_2_1_RELEASE:1.1.1.2
	RELENG_5_2_0_RELEASE:1.1.1.2
	RELENG_5_2:1.1.1.2.0.4
	RELENG_5_2_BP:1.1.1.2
	RELENG_5_1_0_RELEASE:1.1.1.2
	RELENG_5_1:1.1.1.2.0.2
	RELENG_5_1_BP:1.1.1.2
	RELENG_5_0_0_RELEASE:1.1.1.1
	RELENG_5_0:1.1.1.1.0.2
	RELENG_5_0_BP:1.1.1.1
	gcc_3_2_1:1.1.1.1
	FSF:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2002.12.04.15.15.05;	author obrien;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2002.12.04.15.15.05;	author obrien;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2003.03.26.18.12.00;	author kan;	state dead;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#! /bin/sh

# (C) 1998, 1999, 2000 Free Software Foundation
# Originally by Alexandre Oliva <oliva@@dcc.unicamp.br>

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# This script processes *.{sum,log} files, producing a shell-script
# that sends e-mail to the appropriate lists and renames files to
# *.sent.  It currently handles only gcc, but it should be quite easy
# to modify it to handle other packages and its mailing lists.

# The scripts assumes it is run in the root directory of the build
# tree, and it will include all .sum files it finds in the mail
# report.

# configure flags are extracted from ./config.status

# if the BOOT_CFLAGS environment variable is set, it will be included
# in the mail report too.

# The usage pattern of this script is as follows:

# test_summary | more   # so as to observe what should be done

# test_summary | sh     # so as to actually send e-mail and move log files

# It accepts a few command line arguments.  For example:
# -o: re-reads logs that have been mailed already (.sum.sent)
# -t: prevents logs from being renamed
# -p: prepend specified file (or list of files: -p "a b") to the report
# -i: append specified file (or list of files: -i "a b") to the report
# -m: specify the e-mail address to send notes to.  An appropriate default
#     should be selected from the log files.
# -f: force reports to be mailed; if omitted, only reports that differ
#     from the sent.* version are sent.

# Find a good awk.
if test -z "$AWK" ; then
  for AWK in gawk nawk awk ; do
    if type $AWK 2>&1 | grep 'not found' > /dev/null 2>&1 ; then
      :
    else
      break
    fi
  done
fi

: ${filesuffix=}; export filesuffix
: ${move=true}; export move
: ${forcemail=false}; export forcemail
while true; do
    case "$1" in 
      -o) filesuffix=.sent; move=false; : ${mailto=nobody}; shift;;
      -t) move=false; shift;;
      -p) prepend_logs=${prepend_logs+"$prepend_logs "}"$2"; shift 2;;
      -i) append_logs=${append_logs+"$append_logs "}"$2"; shift 2;;
      -m) mailto=$2; forcemail=true; shift 2;;
      -f) unset mailto; forcemail=true; shift;;
      *) break;;
    esac
done
: ${mailto="\" address \""}; export mailto
files=`find . -name \*.sum$filesuffix -print | sort`
anyfile=false anychange=$forcemail &&
for file in $files; do
    [ -f $file ] &&
    anyfile=true &&
    { $anychange ||
      anychange=`diff -u $file.sent $file 2>/dev/null |
	if test ! -f $file.sent ||
	   egrep '^[-+](XPASS|FAIL)' >/dev/null; then
	    echo true
	else
	    echo false
	fi
      `
    }
    true
done &&
$anyfile &&
if $forcemail || $anychange; then :; else mailto=nobody; fi &&
# We use cat instead of listing the files as arguments to AWK because
# GNU awk 3.0.0 would break if any of the filenames contained `=' and
# was preceded by an invalid ``variable'' name.
cat ./config.status $files |
$AWK '
BEGIN {
  lang="";
  address="gcc-testresults@@gcc.gnu.org";
  version="gcc";
  print "cat <<'"'"'EOF'"'"' |";
'${prepend_logs+"  system(\"cat $prepend_logs\"); "}'
}
$1 ~ /\/configure$/ {
    srcdir = $1;
    gsub(/\/configure$/, "", srcdir);
    printf "LAST_UPDATED: ";
    system("tail -1 " srcdir "/LAST_UPDATED");
    print "";

    $1 = "configure flags:"; configflags = $0;
    gsub(/--with-gcc-version-trigger=[^ ]* /, "", configflags);
    gsub(/ --norecursion/, "", configflags)
}
/^Running target / { print ""; print; }
/^Target / { if (host != "") next; else host = $3; }
/^Host / && host ~ /^unix\{.*\}$/ { host = $3 " " substr(host, 5); }
/^Native / { if (host != "") next; else host = $4; }
/^[ 	]*=== [^ 	]+ tests ===/ {
  if (lang == "") lang = " "$2" "; else lang = " ";
}
$2 == "version" { save = $0; $1 = ""; $2 = ""; version = $0; gsub(/^ */, "", version); gsub(/\r$/, "", version); $0 = save; }
/\===.*Summary/ { print ""; print; blanks=1; }
/tests ===/ || /^(Target|Host|Native)/ || $2 == "version" { print; blanks=1; }
/^(XPASS|FAIL|UNRESOLVED|WARNING|ERROR|# of )/ { print; }
# dumpall != 0 && /^X?(PASS|FAIL|UNTESTED)|^testcase/ { dumpall=0; }
# dumpall != 0 { print; }
# /^FAIL/ { dumpall=1; }
/^$/ && blanks>0 { print; --blanks; }
END { if (lang != "") {
  print "";
  print "Compiler version: " prefix version lang;
  print "Platform: " host;
  print configflags;
  '${BOOT_CFLAGS+'print "BOOT_CFLAGS='"${BOOT_CFLAGS}"'";'}'
  if (boot_cflags != 0) print boot_cflags;
'${append_logs+"  system(\"cat $append_logs\"); "}'
  print "EOF";
  print "Mail -s \"Results for " prefix version lang "testsuite on " host "\" '"${mailto}"' &&";
}}
{ next; }
' | sed "s/\([\`\$\\\\]\)/\\\\\\1/g" &&
if $move; then
    for file in $files `ls -1 $files | sed s/sum$/log/`; do
      [ -f $file ] && echo "mv `pwd`/$file `pwd`/$file.sent &&"
    done
fi &&
echo true
exit 0
@


1.1.1.1
log
@Gcc 3.2.1 release virgin vendor import. (19-Nov-2002)
@
text
@@


1.1.1.2
log
@Remove files incidentally imported from the wrong place during
3.2.1 import. They are not used by any of our system GCC versions
and will be physically removed from repository soon.

Reviewed by:	obrien
@
text
@@

