find-build-errors revision 493
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# to whom the Software is furnished to do so, provided that the above
# copyright notice(s) and this permission notice appear in all copies of
# the Software and that both the above copyright notice(s) and this
# permission notice appear in supporting documentation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Except as contained in this notice, the name of a copyright holder
# shall not be used in advertising or otherwise to promote the sale, use
# or other dealings in this Software without prior written authorization
# of the copyright holder.
#
# ident "@(#)find-build-errors 1.1 08/08/07 SMI"
#
require 5.005; # minimal Perl version required
use strict; #
use diagnostics; #
my $default_logfile = 'buildit-XW';
my $logfile;
my $pkglog;
my $pkgfailed;
} else {
}
} else {
# climb the tree, removing one parent at a time to find the logfile
# print "$logfile not found\n";
}
}
}
my @steplines;
my $found_error = 0;
# Finished if we see the end line
$found_error = 0;
}
# If we already hit an error, skip the rest of this module
# Add this line to the saved output, combine with previous if previous
# ended with an \
$steplines[$#steplines] .= $l;
} else {
}
# Skip ahead to next line if this line ends with \
# Found a new error?
$found_error = 1;
# Print section header
my $lastmake;
my $lastcommand = 1;
my $lastplus = 0;
# scan back to figure out how far back to print
my $sl = $steplines[$ln];
# print "lastmake: $lastmake, lastcom: $lastcommand, lastplus: $lastplus, line #$ln: $sl\n";
}
# don't treat this as a command
$lastcommand = $ln;
}
# print from start of shell's set -x output, not end
$lastcommand = $ln;
}
$lastcommand = $ln;
}
}
# print "lastmake: $lastmake, lastcommand: $lastcommand\n";
print $steplines[$lastmake];
}
print $steplines[$ln];
}
}
}
my $printme = 0;
# end of file stuff
print $l;
next;
}
# Look for package build results
$pkglog = $1;
print $l;
$pkgfailed = $1;
print $l;
}
# print lines where messages about COPYING file errors appear
# between "Copying package descriptions" & "Building packages"
$printme = 1;
$printme = 0;
}
print $l;
}
}
}
sub check_pkglog {
# Haven't rebuilt packages since last build, so no point reporting errors
}
} else {
}
return $pl;
}
# No packaging log found in build log, try to guess where it is
my $path_to_check = $logfile;
}
}
my @pkglines;
# Clear saved lines for each new package
}
} else {
}
}
}