Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 2003 11:28:40 -0600 (CST)
From:      Mark Linimon <linimon@lonesome.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/50258: [patch] refactor /usr/ports/Tools/portbuild/scripts/processlogs
Message-ID:  <200303241728.h2OHSe0r064913@lonesome.lonesome.com>

next in thread | raw e-mail | index | archive | help

>Number:         50258
>Category:       ports
>Synopsis:       [patch] refactor /usr/ports/Tools/portbuild/scripts/processlogs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 24 09:30:11 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Mark Linimon
>Release:        FreeBSD-4.7
>Organization:
FreeBSD
>Environment:
System: FreeBSD lonesome.lonesome.com 4.7-STABLE FreeBSD 4.7-STABLE #0: Fri Nov 8 23:46:29 CST 2002 root@lonesome.lonesome.com:/usr/src/sys/compile/MULTIMEDIA i386
>Description:
	The processlogs script (used to build errorlog summaries on bento)
	performs two functions.  One is to scan over all errorlog entries;
	the other is to categorize each errorlog by error type, maintainer,
	and so forth.

	Since it's all in one file, you cannot currently (e.g.) modify
	the "New package building errors" report by adding error type
	(as determined by this logic) to it.  This patch, while not
	accomplishing the former, at least makes it possible to do so by
	creating a script "processonelog" with the per-errorlog logic, and
	leaving "processlogs" with the rest.

	Note that this PR builds on, and replaces, my previous PR ports/48935.
	In addition, some (commented-out) debug lines that I wind up using
	multiple times in working on this script are included :-)  While
	this may violate the one-change-per-commit spirit, IMHO the
	alternative would require some backtracking.
>How-To-Repeat:
	N/A
>Fix:
	The following shar file contains the diff to processlogs; the
	new script processonelog; and an example script processonehref,
	which may or may not be useful in and of itself.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	diff.out
#	processonelog
#	processonehref
#
echo x - diff.out
sed 's/^X//' >diff.out << 'END-of-diff.out'
X--- processlogs.dist	Fri Feb 14 03:28:42 2003
X+++ processlogs	Mon Mar 24 11:12:44 2003
X@@ -1,4 +1,5 @@
X #!/bin/sh
X+#echo 'processlogs: at '`date`', begin'
X 
X of=.index.html
X 
X@@ -16,303 +17,23 @@
X > .logs
X 
X #
X-# Read the log-files and write it to .logs in the format
X+# Read the errorlog files and write summaries to .logs in the format
X #	$filename|$portname|$affected|$logsize|$dir|$maintainer|\
X #	$reason|$tag|$broken|$datetime
X #
X-#
X+
X+#echo 'processlogs: at '`date`', begin processing log files'
X 
X if [ $# != 1 -o "x$1" != "x*.log" ]; then
X   while [ ! -z "$1" ]; do
X     filename=$1
X+    #echo 'processlogs: at '`date`', examining '$filename
X 
X-    portname=$(basename $filename .log)
X-    affected=$(($(grep -cF $portname < INDEX) -1))
X-    logsize=$(/bin/ls -sk $filename | awk '{print $1}')
X-    dir=$(sed -n -e '3p' $filename | awk '{print $4}' | \
X-		sed -e 's,^/[^/]*/[^/]*/,,')
X-    maintainer=$(sed -n -e '4p' $filename | awk '{print $3}')
X-    datetime=$(grep 'build started at' $filename | \
X-		sed -e 's/build started at ...//' | tr ' ' '_' )
X-
X-    # throw out totally bogus files (e.g., blank file, error 404, etc.)
X-    if [ -z "$dir" -a -z "$maintainer" -a -z "$datetime" ]; then
X-       shift
X-       continue
X-    fi
X-
X-    if grep -q 'list of extra files and directories' $1; then
X-      reason="mtree"; tag="mtree"
X-    elif grep -q "See <URL:http://www.gnu.org/software/gcc/bugs.html>; for instructions." $1; then
X-      reason="gcc_bug"; tag="gcc-bug"
X-    elif grep -q 'Checksum mismatch' $1; then
X-      reason="checksum"; tag="checksum"
X-    elif grep -qE '/usr/local/bin/(perl|perl5.6.1):.*(not found|No such file or directory)' $1; then
X-      reason="perl"; tag="perl"
X-    elif grep -qE 'perl(.*): Perl is not installed, try .pkg_add -r perl.' $1; then
X-      reason="perl"; tag="perl"
X-    elif grep -q 'cannot find -lc_r' $1; then
X-      reason="threads"; tag="threads"
X-    elif grep -q "checking for.*lc_r\.\.\. no" $1; then
X-      reason="threads"; tag="threads"
X-    elif grep -qE '(No checksum recorded for|(Maybe|Either) .* is out of date, or)' $1; then
X-      reason="distinfo_update"; tag="distinfo"
X-    elif grep -q "checking whether apxs works.*apxs: not found" $1; then
X-      reason="apxs"; tag="apxs"
X-    elif grep -qE '(configure: error:|script.*failed: here are the contents of)' $1; then
X-      if grep -qE "configure: error: (This program requires STL to compile|One or more.*STL headers are missing)" $1; then
X-        reason="stl"; tag="stl"
X-      elif grep -qE "configure: error: [Pp]erl (5.* required|version too old)" $1; then
X-        reason="perl"; tag="perl"
X-      else
X-        reason="configure_error"; tag="configure"
X-      fi
X-    elif grep -qE '(bison:.*(No such file|not found)|multiple definition of `yy)' $1; then
X-      reason="bison"; tag="bison"
X-    elif grep -q "Couldn't fetch it - please try" $1; then
X-      reason="fetch"; tag="fetch"
X-    elif grep -q "out of .* hunks .*--saving rejects to" $1; then
X-      reason="patch"; tag="patch"
X-    elif grep -q 'Error: category .* not in list of valid categories' $1; then
X-      reason="CATEGORIES"; tag="categories"
X-    elif grep -q 'make: don.t know how to make .*\.man. Stop' $1; then
X-      reason="X_manpage"; tag="xfree4man"
X-    elif grep -q 'Xm/Xm\.h: No such file' $1; then
X-      reason="MOTIF"; tag="motif"
X-    elif grep -q 'undefined reference to `Xp' $1; then
X-      reason="MOTIFLIB"; tag="motiflib"
X-    elif grep -qi 'read-only file system' $1; then
X-      reason="WRKDIR"; tag="wrkdir"
X-    elif grep -q 'makeinfo: .* use --force' $1; then
X-      reason="texinfo"; tag="texinfo"
X-    elif grep -q 'means that you did not run the h2ph script' $1; then
X-      reason="perl5"; tag="perl5"
X-    elif grep -q "Error: shared library \".*\" does not exist" $1; then
X-      reason="LIB_DEPENDS"; tag="libdepends"
X-    elif grep -qE "(crt0|c\+\+rt0)\.o: No such file" $1; then
X-      reason="ELF"; tag="elf"
X-    elif grep -q "machine/soundcard.h: No such file or directory" $1; then
X-      reason="soundcard.h"; tag="soundcard.h"
X-    elif grep -q "values.h: No such file or directory" $1; then
X-      reason="values.h"; tag="values.h"
X-    elif grep -q ".*\.h: No such file" $1; then
X-      if grep -qE "(X11/.*|Xosdefs)\.h: No such file" $1; then
X-	if grep -q "XFree86-.*\.tgz" $1; then
X-	  reason="missing_header"; tag="header"
X-	else
X-	  reason="USE_XLIB"; tag="usexlib"
X-	fi
X-      else
X-	reason="missing_header"; tag="header"
X-      fi
X-    elif grep -q "pnohang: killing make checksum" $1; then
X-      reason="fetch_timeout"; tag="fetch-timeout"
X-    elif grep -q "USER   PID  PPID  PGID JOBC STAT  TT       TIME COMMAND" $1; then
X-      reason="runaway_process"; tag="runaway"
X-    elif grep -q "pnohang: killing make package" $1; then
X-      reason="runaway_process"; tag="runaway"
X-    elif grep -q "cd: can't cd to" $1; then
X-      reason="NFS"; tag="nfs"
X-    elif grep -qE "pkg_add: (can't find enough temporary space|projected size of .* exceeds available free space)" $1; then
X-      reason="disk_full"; tag="df"
X-    elif grep -qE '(parse error|too (many|few) arguments to|argument.*doesn.*prototype|incompatible type for argument|conflicting types for|undeclared \(first use (in |)this function\)|incorrect number of parameters|has incomplete type and cannot be initialized)' $1; then
X-      reason="compiler_error"; tag="cc"
X-    elif grep -qE '(ANSI C.. forbids|is a contravariance violation|changed for new ANSI .for. scoping|[0-9]: passing .* changes signedness|discards qualifiers|lacks a cast|redeclared as different kind of symbol|invalid type .* for default argument to|wrong type argument to unary exclamation mark|duplicate explicit instantiation of|incompatible types in assignment|assuming . on overloaded member function|call of overloaded .* is ambiguous|declaration of C function .* conflicts with|initialization of non-const reference type|using typedef-name .* after|[0-9]: implicit declaration of function|[0-9]: size of array .* is too large|fixed or forbidden register .* for class)' $1; then
X-      reason="new_compiler_error"; tag="newgcc"
X-    elif grep -qE '(syntax error before|ISO C++ forbids|friend declaration|no matching function for call to|.main. must return .int.|invalid conversion from|cannot be used as a macro name as it is an operator in C\+\+|is not a member of type|after previous specification in|no class template named|because worst conversion for the former|better than worst conversion|no match for.*operator|no match for call to|undeclared in namespace|is used as a type, but is not)' $1; then
X-      reason="bad_C++_code"; tag="badc++"
X-    elif grep -qE '(/usr/libexec/elf/ld: cannot find|undefined reference to|cannot open -l.*: No such file)' $1; then
X-      reason="linker_error"; tag="ld"
X-    elif grep -qE 'chown:.*invalid argument' $1; then
X-      reason="chown"; tag="chown"
X-    elif grep -q 'install: .*: No such file' $1; then
X-      if grep -q 'install: /usr/local/www/cgi-bin.*No such file or directory' $1; then
X-        reason="cgi-bin"; tag="cgi-bin"
X-      else
X-        reason="install_error"; tag="install"
X-      fi
X-    elif grep -q "/usr/.*/man/.*: No such file or directory" $1; then
X-      reason="manpage"; tag="manpage"
X-    elif grep -q "pkg_create: make_dist: tar command failed with code" $1; then
X-      reason="PLIST"; tag="plist"
X-    elif grep -qE "(Can't|unable to) open display" $1; then
X-      reason="DISPLAY"; tag="display"
X-    elif grep -q " is already installed - perhaps an older version" $1; then
X-      reason="depend_object"; tag="dependobj"
X-    elif grep -q "error in dependency .*, exiting" $1; then
X-      reason="depend_package"; tag="dependpkg"
X-    elif grep -q "#error \"<malloc.h> has been replaced by <stdlib.h>\"" $1; then
X-      reason="malloc.h"; tag="malloc.h"
X-    elif grep -q "core dumped" $1; then
X-      reason="coredump"; tag="coredump"
X-    elif grep -q "Segmentation fault" $1; then
X-      reason="segfault"; tag="segfault"
X-    elif egrep -q "storage size of.*isn't known" $1; then
X-      reason="union_wait"; tag="wait"
X-    elif grep -q "initializer element is not constant" $1; then
X-      reason="stdio"; tag="stdio"
X-    elif grep -q "structure has no member named" $1; then
X-      reason="struct_changes"; tag="struct"
X-    elif grep -q "Error: alignment not a power of 2" $1; then
X-      reason="alignment"; tag="alignment"
X-    elif grep -qE "bin.apxs:(.)(not found|No such file or directory)" $1; then
X-      reason="apxs"; tag="apxs"
X-    elif grep -qE "failed to exec .*bin/apxs" $1; then
X-      reason="apxs"; tag="apxs"
X-    elif grep -q ".s: Assembler messages:" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "Cannot (determine .* target|find the byte order) for this architecture" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -q "cast from pointer to integer of different size" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "^cc1: bad value.*for -mcpu.*switch" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "^cc1: invalid option " $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "Configuration .* not supported" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -q "could not read symbols: File in wrong format" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "[Ee]rror: [Uu]nknown opcode" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "error.*Unsupported architecture" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -q "ENDIAN must be defined 0 or 1" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -q "failed to merge target-specific data" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "(file not recognized|failed to set dynamic section sizes): File format not recognized" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -q "impossible register constraint" $1; then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "inconsistent operand constraints in an .asm" $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -q "invalid lvalue in asm statement" $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "is only for.*, and you are running" $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -q "relocation truncated to fit: " $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -q "This architecture seems to be neither big endian nor little endian" $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -q "unknown register name" $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -q "Unable to correct byte order" $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -q "Unsupported platform, sorry" $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -q "won't run on this architecture" $1;  then
X-      reason="arch"; tag="arch"
X-    elif grep -qE "#error .Cannot compile:" $1; then
X-      reason="assert"; tag="assert"
X-    elif grep -qE "autoconf(.*): not found" $1; then
X-      reason="autoconf"; tag="autoconf"
X-    elif grep -qE "autoconf(.*): No such file or directory" $1; then
X-      reason="autoconf"; tag="autoconf"
X-    elif grep -q "autoheader: not found" $1; then
X-      reason="autoheader"; tag="autoheader"
X-    elif grep -qE "automake(.*): not found" $1; then
X-      reason="automake"; tag="automake"
X-    elif grep -q "awk: empty regular expression" $1; then
X-      reason="awk"; tag="awk"
X-    elif grep -qE "(mv:|mv: rename|cannot open) y.tab.c(.*): No such file or directory" $1; then
X-      reason="bison"; tag="bison"
X-    elif grep -q "sorry, cannot determine the header file bison generates" $1; then
X-      reason="bison"; tag="bison"
X-    elif grep -q "usage: yacc" $1; then
X-      reason="bison"; tag="bison"
X-    elif grep -q "/usr/local/www/cgi-bin does not exist" $1; then
X-      reason="cgi-bin"; tag="cgi-bin"
X-    elif grep -qE "chown: .*\..*: Invalid argument" $1; then
X-      reason="chown"; tag="chown"
X-    elif grep -q "Cannot stat: " $1; then
X-      reason="configure_error"; tag="configure"
X-    elif grep -qE "Script.*configure.*failed unexpectedly" $1; then
X-      reason="configure_error"; tag="configure"
X-    elif grep -q "Cannot open /dev/tty for read" $1; then
X-      reason="DISPLAY"; tag="display"
X-    elif grep -q "RuntimeError: cannot open display" $1; then
X-      reason="DISPLAY"; tag="display"
X-    elif grep -q "You must run this program under the X-Window System" $1; then
X-      reason="DISPLAY"; tag="display"
X-    elif grep -q "ld: unrecognised emulation mode: elf_i386" $1; then
X-      reason="ELF"; tag="elf"
X-    elif grep -qE "Member name contains .\.\." $1; then
X-      reason="fetch"; tag="fetch"
X-    elif grep -q "fetch: transfer timed out" $1; then
X-      reason="fetch_timeout"; tag="fetch-timeout"
X-    elif grep -q "fetch: transfer timed out" $1; then
X-      reason="fetch_timeout"; tag="fetch-timeout"
X-    elif grep -q "strings.h:.* previous declaration of .int ffs" $1; then
X-      reason="ffs_conflict"; tag="ffs_conflict"
X-    elif grep -q "is forbidden: FreeBSD-SA-" $1; then
X-      reason="forbidden"; tag="forbidden"
X-    elif grep -qE "previous declaration.*int getopt" $1; then
X-      reason="getopt.h"; tag="getopt.h"
X-    elif grep -q 'Run-time system build failed for some reason' $1; then
X-      reason="install_error"; tag="install"
X-    elif grep -q "/usr/bin/ld: cannot find -lc_r" $1; then
X-      reason="lc_r"; tag="lc_r"
X-    elif grep -q "cc: .*libintl.*: No such file or directory" $1; then
X-      reason="linker_error"; tag="ld"
X-    elif grep -qE "cc: ndbm\.so: No such file or directory" $1; then
X-      reason="linker_error"; tag="ld"
X-    elif grep -q "error: The X11 shared library could not be loaded" $1; then
X-      reason="linker_error"; tag="ld"
X-    elif grep -q "relocation against dynamic symbol" $1; then
X-      reason="linker_error"; tag="ld"
X-    elif grep -qE "make.*(don.t know how to make|fatal errors encountered|No rule to make target|built-in)" $1; then
X-      reason="makefile"; tag="makefile"
X-    elif grep -q "Error: mtree file ./etc/mtree/BSD.local.dist. is missing" $1; then
X-      reason="mtree"; tag="mtree"
X-    elif grep -qE "cp:.*site_perl: No such file or directory" $1; then
X-      reason="perl"; tag="perl"
X-    elif grep -q "Perl .* required--this is only version" $1; then
X-      reason="perl"; tag="perl"
X-    elif grep -q "pod2man: not found" $1; then
X-      reason="pod2man"; tag="pod2man"
X-    elif grep -q "Syntax error: .(. unexpected (expecting .fi.)" $1; then
X-      reason="portcomment"; tag="portcomment"
X-    elif grep -q "Abort trap" $1; then
X-      reason="process_failed"; tag="process"
X-    elif grep -q "Bus error" $1; then
X-      reason="process_failed"; tag="process"
X-    elif grep -q "Signal 11" $1; then
X-      reason="process_failed"; tag="process"
X-    elif grep -q "USER   PID  PPID  PGID JOBC STAT  TT       TIME COMMAND" $1; then
X-      reason="process_failed"; tag="process"
X-    elif grep -q "python: not found" $1; then
X-      reason="python"; tag="python"
X-    elif grep -qE "sed: illegal option" $1; then
X-      reason="sed"; tag="sed"
X-    elif grep -qE "sed: [0-9]*:.*(RE error:|not defined in the RE|bad flag in substitute command|unescaped newline inside substitute pattern|invalid command code)" $1; then
X-      reason="sed"; tag="sed"
X-    elif grep -q "Your STL string implementation is unusable" $1; then
X-      reason="stl"; tag="stl"
X-    elif grep -q "Error: pthreads are required to build this package" $1; then
X-      reason="threads"; tag="threads"
X-    elif grep -q "Please install/update your POSIX threads (pthreads) library" $1; then
X-      reason="threads"; tag="threads"
X-    elif grep -qE "requires.*thread support" $1; then
X-      reason="threads"; tag="threads"
X-    elif grep -q "/usr/bin/ld: cannot find -lpthread" $1; then
X-      reason="threads"; tag="threads"
X-    elif grep -q "/usr/bin/ld: cannot find -lXThrStub" $1; then
X-      reason="threads"; tag="threads"
X-
X-    else
X-      reason="???"; tag="unknown"
X-    fi
X-
X-    broken="no"
X-    if grep -q "Trying build of .* even though it is marked BROKEN" $1; then
X-       broken="broken"
X-    fi
X+    $(dirname $0)/processonelog $filename >> .logs
X     shift
X-
X-    echo "$filename|$portname|$affected|$logsize|$dir|$maintainer|$reason|$tag|$broken|$datetime" >> .logs
X   done
X fi
X+#echo 'processlogs: at '`date`', end processing log files'
X 
X # XXX Sometimes log entries get doubled up for some reason
X uniq .logs > .logs2
X@@ -337,7 +58,7 @@
X     if [ -s cvsdone ]; then
X       echo "CVS update finished at: $(cat cvsdone)<br>" >> $of
X     fi
X-    echo "Timestamp of newest log: $(ls -rtTl *.log | tail -1 | awk '{printf("%s %s %s %s\n",$6,$7,$8,$9)}')<br><br>" >> $of
X+    echo "Timestamp of newest log: $(ls -rtTl *.log | tail -1 | awk '{printf("%s %s %s %s\n",$6,$7,$8,$9)}') <br><br>" >> $of
X     echo "\"Aff.\" is number of ports that depend on this one<br>" >> $of
X     echo "\"<font color=\"red\">[B]</font>\" indicates port is marked BROKEN<br><br>" >> $of
X     echo "<p>$num errors</p>" >> $of
X@@ -352,6 +73,12 @@
X   echo "</html>" >>$of
X }
X 
X+# Now reread the .logs file and create the reports.  If the .logs file
X+# has blanks in any field, this code won't work.  Therefore, the
X+# code above has to guarantee that that won't happen, and the code
X+# below has to catch the metatoken.
X+
X+#echo 'processlogs: at '`date`', create default output'
X #
X # Create "default" output, sorted on portname
X #
X@@ -359,14 +86,22 @@
X 
X for i in `cat .logs | sort`; do
X     set $(echo $i | tr \| " ")
X+    if [ "$6" = "NONE" ] ; then
X+       mailto="&nbsp;"
X+    else
X+       mailto="<a href=\"mailto:$6\">$6</a>"
X+    fi
X+    set $(echo $i | tr \| " " | sed -e "s@NONE@\\&nbsp;@g")
X+
X     echo "<tr>" >> $of
X+
X     echo "<td><a href=\"$1\">$2</a></td>" >> $of
X 
X     affby=$3
X     test $affby = "0" -o $affby = "-1" && affby="&nbsp;"
X     echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
X     echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
X-    echo "<td><a href=\"mailto:$6\">$6</a></td>" >> $of
X+    echo "<td>$mailto</td>" >> $of
X     echo "<td>" >> $of
X 
X     test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
X@@ -382,6 +117,7 @@
X footer ""
X mv -f $of index.html
X 
X+#echo 'processlogs: at '`date`', create output sorted by category'
X #
X # Create output by category
X #
X@@ -389,14 +125,22 @@
X 
X for i in `cat .logs | sort -t \\| +4`; do
X     set $(echo $i | tr \| " ")
X+    if [ "$6" = "NONE" ] ; then
X+       mailto="&nbsp;"
X+    else
X+       mailto="<a href=\"mailto:$6\">$6</a>"
X+    fi
X+    set $(echo $i | tr \| " " | sed -e "s@NONE@\\&nbsp;@g")
X+
X     echo "<tr>" >> $of
X+
X     echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
X 
X     affby=$3
X     test $affby = "0" -o $affby = "-1" && affby="&nbsp;"
X     echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
X     echo "<td><a href=\"$1\">$2</a></td>" >> $of
X-    echo "<td><a href=\"mailto:$6\">$6</a></td>" >> $of
X+    echo "<td>$mailto</td>" >> $of
X 
X     echo "<td>" >> $of
X     test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
X@@ -412,6 +156,7 @@
X footer ""
X mv -f $of index-category.html
X 
X+#echo 'processlogs: at '`date`', create output sorted by maintainer'
X #
X # Create output by maintainer
X #
X@@ -419,8 +164,16 @@
X 
X for i in `cat .logs | sort -t \\| +5`; do
X     set $(echo $i | tr \| " ")
X+    if [ "$6" = "NONE" ] ; then
X+       mailto="&nbsp;"
X+    else
X+       mailto="<a href=\"mailto:$6\">$6</a>"
X+    fi
X+    set $(echo $i | tr \| " " | sed -e "s@NONE@\\&nbsp;@g")
X+
X     echo "<tr>" >> $of
X-    echo "<td><a href=\"mailto:$6\">$6</a></td>" >> $of
X+
X+    echo "<td>$mailto</td>" >> $of
X     echo "<td><a href=\"$1\">$2</a></td>" >> $of
X 
X     affby=$3
X@@ -442,6 +195,7 @@
X footer ""
X mv -f $of index-maintainer.html
X 
X+#echo 'processlogs: at '`date`', create output sorted by error'
X #
X # Create output by error
X #
X@@ -449,6 +203,13 @@
X 
X for i in `cat .logs | sort -t \\| +7`; do
X     set $(echo $i | tr \| " ")
X+    if [ "$6" = "NONE" ] ; then
X+       mailto="&nbsp;"
X+    else
X+       mailto="<a href=\"mailto:$6\">$6</a>"
X+    fi
X+    set $(echo $i | tr \| " " | sed -e "s@NONE@\\&nbsp;@g")
X+
X     echo "<tr>" >> $of
X 
X     echo "<td>" >> $of
X@@ -463,7 +224,7 @@
X     test $affby = "0" -o $affby = "-1" && affby="&nbsp;"
X     echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
X     echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
X-    echo "<td><a href=\"mailto:$6\">$6</a></td>" >> $of
X+    echo "<td>$mailto</td>" >> $of
X 
X     date=$(echo ${10} | tr '_' ' ')
X     echo "<td>$date</td>" >> $of
X@@ -473,6 +234,7 @@
X footer ""
X mv -f $of index-reason.html
X 
X+#echo 'processlogs: at '`date`', create output sorted by builddate'
X #
X # Create output by builddate
X #
X@@ -480,6 +242,13 @@
X 
X for i in `cat .logs | sort -t \\| +9`; do
X     set $(echo $i | tr \| " ")
X+    if [ "$6" = "NONE" ] ; then
X+       mailto="&nbsp;"
X+    else
X+       mailto="<a href=\"mailto:$6\">$6</a>"
X+    fi
X+    set $(echo $i | tr \| " " | sed -e "s@NONE@\\&nbsp;@g")
X+
X     echo "<tr>" >> $of
X 
X     date=$(echo ${10} | tr '_' ' ')
X@@ -491,7 +260,7 @@
X     test $affby = "0" -o $affby = "-1" && affby="&nbsp;"
X     echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
X     echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
X-    echo "<td><a href=\"mailto:$6\">$6</a></td>" >> $of
X+    echo "<td>$mailto</td>" >> $of
X 
X     echo "<td>" >> $of
X     test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
X@@ -504,11 +273,19 @@
X footer ""
X mv -f $of index-builddate.html
X 
X+#echo 'processlogs: at '`date`', create maintainer list'
X #
X # Get list of maintainers.
X #
X for i in `cat .logs | sort -t \\| +9`; do
X     set $(echo $i | tr \| " ")
X+    if [ "$6" = "NONE" ] ; then
X+       mailto="&nbsp;"
X+    else
X+       mailto="<a href=\"mailto:$6\">$6</a>"
X+    fi
X+    set $(echo $i | tr \| " " | sed -e "s@NONE@\\&nbsp;@g")
X+
X     maints="$maints $6"
X done
X 
X@@ -516,3 +293,4 @@
X /g' | sort -fu > maintainers
X 
X rm .lock
X+#echo 'processlogs: at '`date`', end'
END-of-diff.out
echo x - processonelog
sed 's/^X//' >processonelog << 'END-of-processonelog'
X#!/bin/sh
X# $FreeBSD$
X#
X# Read a single errorlogfile and output a line of the format
X#	$filename|$portname|$affected|$logsize|$dir|$maintainer|\
X#	$reason|$tag|$broken|$datetime
X#
X# Originally factored out of: ports/Tools/portbuild/scripts/processlogs
X
Xfilename=$1
X
Xportname=$(basename $filename .log)
Xaffected=$(($(grep -cF $portname < INDEX) -1))
Xlogsize=$(/bin/ls -sk $filename | awk '{print $1}')
Xdir=$(sed -n -e '3p' $filename | grep '^with arguments' | awk '{print $4}' | \
X		sed -e 's,^/[^/]*/[^/]*/,,')
Xmaintainer=$(sed -n -e '4p' $filename | grep '^maintained by' | awk '{print $3}')
Xdatetime=$(sed -n -e '5p' $filename | grep '^build started at' | \
X		sed -e 's/build started at ...//' | tr ' ' '_' )
X
X# now try to classify the type of error found in the file.
X# the first case handles failures to even try to build any
X# port (i.e. HTML file no longer there, bento being unable
X# to fetch any file, bento being able to build any port, etc.)
Xif [ -z "$dir" -o -z "$datetime" ]; then
X  reason="cluster"; tag="cluster"
Xelif grep -q 'list of extra files and directories' $1; then
X  reason="mtree"; tag="mtree"
Xelif grep -q "See <URL:http://www.gnu.org/software/gcc/bugs.html>; for instructions." $1; then
X  reason="gcc_bug"; tag="gcc-bug"
Xelif grep -q 'Checksum mismatch' $1; then
X  reason="checksum"; tag="checksum"
Xelif grep -qE '/usr/local/bin/(perl|perl5.6.1):.*(not found|No such file or directory)' $1; then
X  reason="perl"; tag="perl"
Xelif grep -qE 'perl(.*): Perl is not installed, try .pkg_add -r perl.' $1; then
X  reason="perl"; tag="perl"
Xelif grep -q 'cannot find -lc_r' $1; then
X  reason="threads"; tag="threads"
Xelif grep -q "checking for.*lc_r\.\.\. no" $1; then
X  reason="threads"; tag="threads"
Xelif grep -qE '(No checksum recorded for|(Maybe|Either) .* is out of date, or)' $1; then
X  reason="distinfo_update"; tag="distinfo"
Xelif grep -q "checking whether apxs works.*apxs: not found" $1; then
X  reason="apxs"; tag="apxs"
Xelif grep -qE '(configure: error:|script.*failed: here are the contents of)' $1; then
X  if grep -qE "configure: error: (This program requires STL to compile|One or more.*STL headers are missing)" $1; then
X    reason="stl"; tag="stl"
X  elif grep -qE "configure: error: [Pp]erl (5.* required|version too old)" $1; then
X    reason="perl"; tag="perl"
X  else
X    reason="configure_error"; tag="configure"
X  fi
Xelif grep -qE '(bison:.*(No such file|not found)|multiple definition of `yy)' $1; then
X  reason="bison"; tag="bison"
Xelif grep -q "Couldn't fetch it - please try" $1; then
X  reason="fetch"; tag="fetch"
Xelif grep -q "out of .* hunks .*--saving rejects to" $1; then
X  reason="patch"; tag="patch"
Xelif grep -q 'Error: category .* not in list of valid categories' $1; then
X  reason="CATEGORIES"; tag="categories"
Xelif grep -q 'make: don.t know how to make .*\.man. Stop' $1; then
X  reason="X_manpage"; tag="xfree4man"
Xelif grep -q 'Xm/Xm\.h: No such file' $1; then
X  reason="MOTIF"; tag="motif"
Xelif grep -q 'undefined reference to `Xp' $1; then
X  reason="MOTIFLIB"; tag="motiflib"
Xelif grep -qi 'read-only file system' $1; then
X  reason="WRKDIR"; tag="wrkdir"
Xelif grep -q 'makeinfo: .* use --force' $1; then
X  reason="texinfo"; tag="texinfo"
Xelif grep -q 'means that you did not run the h2ph script' $1; then
X  reason="perl5"; tag="perl5"
Xelif grep -q "Error: shared library \".*\" does not exist" $1; then
X  reason="LIB_DEPENDS"; tag="libdepends"
Xelif grep -qE "(crt0|c\+\+rt0)\.o: No such file" $1; then
X  reason="ELF"; tag="elf"
Xelif grep -q "machine/soundcard.h: No such file or directory" $1; then
X  reason="soundcard.h"; tag="soundcard.h"
Xelif grep -q "values.h: No such file or directory" $1; then
X  reason="values.h"; tag="values.h"
Xelif grep -q ".*\.h: No such file" $1; then
X  if grep -qE "(X11/.*|Xosdefs)\.h: No such file" $1; then
X	if grep -q "XFree86-.*\.tgz" $1; then
X	  reason="missing_header"; tag="header"
X	else
X	  reason="USE_XLIB"; tag="usexlib"
X	fi
X  else
X	reason="missing_header"; tag="header"
X  fi
Xelif grep -q "pnohang: killing make checksum" $1; then
X  reason="fetch_timeout"; tag="fetch-timeout"
Xelif grep -q "USER   PID  PPID  PGID JOBC STAT  TT       TIME COMMAND" $1; then
X  reason="runaway_process"; tag="runaway"
Xelif grep -q "pnohang: killing make package" $1; then
X  reason="runaway_process"; tag="runaway"
Xelif grep -q "cd: can't cd to" $1; then
X  reason="NFS"; tag="nfs"
Xelif grep -qE "pkg_add: (can't find enough temporary space|projected size of .* exceeds available free space)" $1; then
X  reason="disk_full"; tag="df"
Xelif grep -qE '(parse error|too (many|few) arguments to|argument.*doesn.*prototype|incompatible type for argument|conflicting types for|undeclared \(first use (in |)this function\)|incorrect number of parameters|has incomplete type and cannot be initialized)' $1; then
X  reason="compiler_error"; tag="cc"
Xelif grep -qE '(ANSI C.. forbids|is a contravariance violation|changed for new ANSI .for. scoping|[0-9]: passing .* changes signedness|discards qualifiers|lacks a cast|redeclared as different kind of symbol|invalid type .* for default argument to|wrong type argument to unary exclamation mark|duplicate explicit instantiation of|incompatible types in assignment|assuming . on overloaded member function|call of overloaded .* is ambiguous|declaration of C function .* conflicts with|initialization of non-const reference type|using typedef-name .* after|[0-9]: implicit declaration of function|[0-9]: size of array .* is too large|fixed or forbidden register .* for class)' $1; then
X  reason="new_compiler_error"; tag="newgcc"
Xelif grep -qE '(syntax error before|ISO C++ forbids|friend declaration|no matching function for call to|.main. must return .int.|invalid conversion from|cannot be used as a macro name as it is an operator in C\+\+|is not a member of type|after previous specification in|no class template named|because worst conversion for the former|better than worst conversion|no match for.*operator|no match for call to|undeclared in namespace|is used as a type, but is not)' $1; then
X  reason="bad_C++_code"; tag="badc++"
Xelif grep -qE '(/usr/libexec/elf/ld: cannot find|undefined reference to|cannot open -l.*: No such file)' $1; then
X  reason="linker_error"; tag="ld"
Xelif grep -qE 'chown:.*invalid argument' $1; then
X  reason="chown"; tag="chown"
Xelif grep -q 'install: .*: No such file' $1; then
X  if grep -q 'install: /usr/local/www/cgi-bin.*No such file or directory' $1; then
X    reason="cgi-bin"; tag="cgi-bin"
X  else
X    reason="install_error"; tag="install"
X  fi
Xelif grep -q "/usr/.*/man/.*: No such file or directory" $1; then
X  reason="manpage"; tag="manpage"
Xelif grep -q "pkg_create: make_dist: tar command failed with code" $1; then
X  reason="PLIST"; tag="plist"
Xelif grep -qE "(Can't|unable to) open display" $1; then
X  reason="DISPLAY"; tag="display"
Xelif grep -q " is already installed - perhaps an older version" $1; then
X  reason="depend_object"; tag="dependobj"
Xelif grep -q "error in dependency .*, exiting" $1; then
X  reason="depend_package"; tag="dependpkg"
Xelif grep -q "#error \"<malloc.h> has been replaced by <stdlib.h>\"" $1; then
X  reason="malloc.h"; tag="malloc.h"
Xelif grep -q "core dumped" $1; then
X  reason="coredump"; tag="coredump"
Xelif grep -q "Segmentation fault" $1; then
X  reason="segfault"; tag="segfault"
Xelif egrep -q "storage size of.*isn't known" $1; then
X  reason="union_wait"; tag="wait"
Xelif grep -q "initializer element is not constant" $1; then
X  reason="stdio"; tag="stdio"
Xelif grep -q "structure has no member named" $1; then
X  reason="struct_changes"; tag="struct"
Xelif grep -q "Error: alignment not a power of 2" $1; then
X  reason="alignment"; tag="alignment"
Xelif grep -qE "bin.apxs:(.)(not found|No such file or directory)" $1; then
X  reason="apxs"; tag="apxs"
Xelif grep -qE "failed to exec .*bin/apxs" $1; then
X  reason="apxs"; tag="apxs"
Xelif grep -q ".s: Assembler messages:" $1; then
X  reason="arch"; tag="arch"
Xelif grep -qE "Cannot (determine .* target|find the byte order) for this architecture" $1; then
X  reason="arch"; tag="arch"
Xelif grep -q "cast from pointer to integer of different size" $1; then
X  reason="arch"; tag="arch"
Xelif grep -qE "^cc1: bad value.*for -mcpu.*switch" $1; then
X  reason="arch"; tag="arch"
Xelif grep -qE "^cc1: invalid option " $1; then
X  reason="arch"; tag="arch"
Xelif grep -qE "Configuration .* not supported" $1; then
X  reason="arch"; tag="arch"
Xelif grep -q "could not read symbols: File in wrong format" $1; then
X  reason="arch"; tag="arch"
Xelif grep -qE "[Ee]rror: [Uu]nknown opcode" $1; then
X  reason="arch"; tag="arch"
Xelif grep -qE "error.*Unsupported architecture" $1; then
X  reason="arch"; tag="arch"
Xelif grep -q "ENDIAN must be defined 0 or 1" $1; then
X  reason="arch"; tag="arch"
Xelif grep -q "failed to merge target-specific data" $1; then
X  reason="arch"; tag="arch"
Xelif grep -qE "(file not recognized|failed to set dynamic section sizes): File format not recognized" $1; then
X  reason="arch"; tag="arch"
Xelif grep -q "impossible register constraint" $1; then
X  reason="arch"; tag="arch"
Xelif grep -qE "inconsistent operand constraints in an .asm" $1;  then
X  reason="arch"; tag="arch"
Xelif grep -q "invalid lvalue in asm statement" $1;  then
X  reason="arch"; tag="arch"
Xelif grep -qE "is only for.*, and you are running" $1;  then
X  reason="arch"; tag="arch"
Xelif grep -q "relocation truncated to fit: " $1;  then
X  reason="arch"; tag="arch"
Xelif grep -q "This architecture seems to be neither big endian nor little endian" $1;  then
X  reason="arch"; tag="arch"
Xelif grep -q "unknown register name" $1;  then
X  reason="arch"; tag="arch"
Xelif grep -q "Unable to correct byte order" $1;  then
X  reason="arch"; tag="arch"
Xelif grep -q "Unsupported platform, sorry" $1;  then
X  reason="arch"; tag="arch"
Xelif grep -q "won't run on this architecture" $1;  then
X  reason="arch"; tag="arch"
Xelif grep -qE "#error .Cannot compile:" $1; then
X  reason="assert"; tag="assert"
Xelif grep -qE "autoconf(.*): not found" $1; then
X  reason="autoconf"; tag="autoconf"
Xelif grep -qE "autoconf(.*): No such file or directory" $1; then
X  reason="autoconf"; tag="autoconf"
Xelif grep -q "autoheader: not found" $1; then
X  reason="autoheader"; tag="autoheader"
Xelif grep -qE "automake(.*): not found" $1; then
X  reason="automake"; tag="automake"
Xelif grep -q "awk: empty regular expression" $1; then
X  reason="awk"; tag="awk"
Xelif grep -qE "(mv:|mv: rename|cannot open) y.tab.c(.*): No such file or directory" $1; then
X  reason="bison"; tag="bison"
Xelif grep -q "sorry, cannot determine the header file bison generates" $1; then
X  reason="bison"; tag="bison"
Xelif grep -q "usage: yacc" $1; then
X  reason="bison"; tag="bison"
Xelif grep -q "/usr/local/www/cgi-bin does not exist" $1; then
X  reason="cgi-bin"; tag="cgi-bin"
Xelif grep -qE "chown: .*\..*: Invalid argument" $1; then
X  reason="chown"; tag="chown"
Xelif grep -q "Cannot stat: " $1; then
X  reason="configure_error"; tag="configure"
Xelif grep -q "make: cannot open Makefile" $1; then
X  reason="configure_error"; tag="configure"
Xelif grep -qE "Script.*configure.*failed unexpectedly" $1; then
X  reason="configure_error"; tag="configure"
Xelif grep -q "Cannot open /dev/tty for read" $1; then
X  reason="DISPLAY"; tag="display"
Xelif grep -q "RuntimeError: cannot open display" $1; then
X  reason="DISPLAY"; tag="display"
Xelif grep -q "You must run this program under the X-Window System" $1; then
X  reason="DISPLAY"; tag="display"
Xelif grep -q "ld: unrecognised emulation mode: elf_i386" $1; then
X  reason="ELF"; tag="elf"
Xelif grep -qE "Member name contains .\.\." $1; then
X  reason="fetch"; tag="fetch"
Xelif grep -q "fetch: transfer timed out" $1; then
X  reason="fetch_timeout"; tag="fetch-timeout"
Xelif grep -q "fetch: transfer timed out" $1; then
X  reason="fetch_timeout"; tag="fetch-timeout"
Xelif grep -q "strings.h:.* previous declaration of .int ffs" $1; then
X  reason="ffs_conflict"; tag="ffs_conflict"
Xelif grep -q "is forbidden: FreeBSD-SA-" $1; then
X  reason="forbidden"; tag="forbidden"
Xelif grep -qE "previous declaration.*int getopt" $1; then
X  reason="getopt.h"; tag="getopt.h"
Xelif grep -q 'Run-time system build failed for some reason' $1; then
X  reason="install_error"; tag="install"
Xelif grep -q "/usr/bin/ld: cannot find -lc_r" $1; then
X  reason="lc_r"; tag="lc_r"
Xelif grep -q "cc: .*libintl.*: No such file or directory" $1; then
X  reason="linker_error"; tag="ld"
Xelif grep -qE "cc: ndbm\.so: No such file or directory" $1; then
X  reason="linker_error"; tag="ld"
Xelif grep -q "error: The X11 shared library could not be loaded" $1; then
X  reason="linker_error"; tag="ld"
Xelif grep -q "relocation against dynamic symbol" $1; then
X  reason="linker_error"; tag="ld"
Xelif grep -qE "make.*(don.t know how to make|fatal errors encountered|No rule to make target|built-in)" $1; then
X  reason="makefile"; tag="makefile"
Xelif grep -q "Error: mtree file ./etc/mtree/BSD.local.dist. is missing" $1; then
X  reason="mtree"; tag="mtree"
Xelif grep -qE "cp:.*site_perl: No such file or directory" $1; then
X  reason="perl"; tag="perl"
Xelif grep -qE "perl. is needed, and you do not seem to have it" $1; then
X  reason="perl"; tag="perl"
Xelif grep -qE "Perl .* required--this is only version" $1; then
X  reason="perl"; tag="perl"
Xelif grep -q "pod2man: not found" $1; then
X  reason="pod2man"; tag="pod2man"
Xelif grep -q "Syntax error: .(. unexpected (expecting .fi.)" $1; then
X  reason="portcomment"; tag="portcomment"
Xelif grep -q "Abort trap" $1; then
X  reason="process_failed"; tag="process"
Xelif grep -q "Bus error" $1; then
X  reason="process_failed"; tag="process"
Xelif grep -q "Signal 11" $1; then
X  reason="process_failed"; tag="process"
Xelif grep -q "USER   PID  PPID  PGID JOBC STAT  TT       TIME COMMAND" $1; then
X  reason="process_failed"; tag="process"
Xelif grep -q "python: not found" $1; then
X  reason="python"; tag="python"
Xelif grep -qE "sed: illegal option" $1; then
X  reason="sed"; tag="sed"
Xelif grep -qE "sed: [0-9]*:.*(RE error:|not defined in the RE|bad flag in substitute command|unescaped newline inside substitute pattern|invalid command code)" $1; then
X  reason="sed"; tag="sed"
Xelif grep -q "Your STL string implementation is unusable" $1; then
X  reason="stl"; tag="stl"
Xelif grep -q "Error: pthreads are required to build this package" $1; then
X  reason="threads"; tag="threads"
Xelif grep -q "Please install/update your POSIX threads (pthreads) library" $1; then
X  reason="threads"; tag="threads"
Xelif grep -qE "requires.*thread support" $1; then
X  reason="threads"; tag="threads"
Xelif grep -q "/usr/bin/ld: cannot find -lpthread" $1; then
X  reason="threads"; tag="threads"
Xelif grep -q "/usr/bin/ld: cannot find -lXThrStub" $1; then
X  reason="threads"; tag="threads"
Xelif grep -q "port wants the OpenSSL library from the FreeBSD base system" $1; then
X  reason="use_openssl_base"; tag="use_openssl_base"
X
Xelse
X  reason="???"; tag="unknown"
Xfi
X
X# XXX MCL perhaps segfault, coredump should be unified into process failed?
X
X# clean up some error cases -- the way .logs works, it expects that
X# every field in it MUST be nonblank, so we insert a metatoken here.
X# See below.
Xif [ -z "$dir" ]; then
X   dir="NONE"
Xfi
Xif [ -z "$maintainer" ]; then
X   maintainer="NONE"
Xfi
Xif [ -z "$datetime" ]; then
X   datetime="NONE"
Xfi
X
Xbroken="no"
Xif grep -q "Trying build of .* even though it is marked BROKEN" $1; then
X   broken="broken"
Xfi
X
Xecho "$filename|$portname|$affected|$logsize|$dir|$maintainer|$reason|$tag|$broken|$datetime"
END-of-processonelog
echo x - processonehref
sed 's/^X//' >processonehref << 'END-of-processonehref'
X#!/bin/sh
X#
X# Read an errorlog file and write an href pointing to the file with
X#	the label shown as the error type
X# Refactored from /usr/ports/Tools/portbuild/scripts/processlogs
X#
Xif [ $# != 1 -o "x$1" != "x*.log" ]; then
X  if [ ! -z "$1" ]; then
X    result=$($(dirname $0)/processonelog $1)
X    set $(echo $result | tr \| " ")
X    reason=$(echo $7 | tr '_' ' ')
X    echo "<a href=\"http://bento.freebsd.org/#$8\">$reason</a>"
X  fi
Xfi
END-of-processonehref
exit

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303241728.h2OHSe0r064913>