find-build-errors revision 970
970N/A# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 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 970N/A# Log file from new pkg(5) build (in same directory as $default_logfile) 970N/A# Log file from old SVR4 package build: 493N/A # climb the tree, removing one parent at a time to find the logfile 493N/A# print "$logfile not found\n"; 970N/A # Look for package build results 970N/A # print lines where messages about COPYING file errors appear 970N/A # between "Copying package descriptions" & "Building packages" 970N/A# Input: string containing name of logfile 970N/A# Prints errors from make output log 970N/A# Returns open log file pointer for post-processing 493N/A # Finished if we see the end line 970N/A ($l =~ m{^\#\# [[:upper:]][[:lower:]]+ing }ms) || # pkg pattern 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); 970N/A if (($l =~ m{\*\*\* }ms) || ($l =~ m{^(d)?make: Fatal error}ms)) { 970N/A next if ($summary_only); 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 # 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 970N/A # Clear saved lines for each new package 970N/A # Warnings we can ignore 970N/A # Clear saved lines for each new class of issue 970N/A # These issues print across two lines 970N/A 'Entries that differ between manifests and proto area:') 970N/A # strip off prefixes for comparisons 970N/A # Warnings we can ignore 970N/A # validate_pkg doesn't like hardlinks to isaexec from our pkgs 970N/A if ($l =~ m{^$}) { # Blank lines separate sections