find-build-errors revision 919
0N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2362N/A# Use is subject to license terms. 0N/A# Permission is hereby granted, free of charge, to any person obtaining a 0N/A# copy of this software and associated documentation files (the "Software"), 0N/A# to deal in the Software without restriction, including without limitation 2362N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense, 0N/A# and/or sell copies of the Software, and to permit persons to whom the 2362N/A# Software is furnished to do so, subject to the following conditions: 0N/A# The above copyright notice and this permission notice (including the next 0N/A# paragraph) shall be included in all copies or substantial portions of the 0N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 0N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 0N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 0N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 0N/Arequire 5.005;
# minimal Perl version required 0N/A # climb the tree, removing one parent at a time to find the logfile 0N/A# print "$logfile not found\n"; print "Scanning $logfile for error messages...\n\n"; # Finished if we see the end line if (($l =~ m{^\#\# making \S+ in \S+\.\.\.$}ms) || # open-src pattern ($l =~ m{^\S+ing( \S+)* in \S+\.\.\.$}ms)) { # xc pattern # If we already hit an error, skip the rest of this module next if ($found_error != 0); # Add this line to the saved output, combine with previous if previous if (($#steplines >= 0) && ($steplines[$#steplines] =~ m{\\\Z}ms)) { $steplines[$#steplines] .= $l; # Skip ahead to next line if this line ends with \ next if ($l =~ m{\\\Z}ms); if (($l =~ m{\*\*\* }ms) || ($l =~ m{^make: Fatal error}ms)) { print $steplines[0], "\n"; # scan back to figure out how far back to print for my $ln (1..($#steplines - 1)) { my $sl = $steplines[$ln]; # print "lastmake: $lastmake, lastcom: $lastcommand, lastplus: $lastplus, line #$ln: $sl\n"; if ($sl =~ m{\b(make|dmake|gmake)\b}ms) { if ($sl =~ m{\breturned\b}ms) { } elsif ($sl =~ m{^\+ }ms) { # print from start of shell's set -x output, not end # print "lastmake: $lastmake, lastcommand: $lastcommand\n"; print "\n", '-'x78, "\n"; # Look for package build results # print lines where messages about COPYING file errors appear # between "Copying package descriptions" & "Building packages" # Haven't rebuilt packages since last build, so no point reporting errors # No packaging log found in build log, try to guess where it is # Clear saved lines for each new package