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