use warnings;
use POSIX qw(strftime);
use Data::Dumper;
+use Getopt::Std;
my $name = "analyze_results";
my $repo = "https://git.einval.com/cgi-bin/gitweb.cgi?p=buildd-scripts.git";
my $time_end;
my $time_taken;
my $num_fail = 0;
+my $awaiting_analysis = 0;
my $lines_read = 0;
my $existing_bugs = 0;
message => 'Architecture mismatch',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_ARCH_MISMATCH,
},
{
message => 'Architecture mismatch',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_ARCH_MISMATCH,
},
{
message => 'No binaries built',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_ARCH_MISMATCH,
},
{
message => 'Could not find specified source package',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_NO_SOURCE,
},
{
message => 'Schroot setup failure',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_INFRA,
},
{
message => 'Build ran out of disk space',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_INFRA,
},
{
message => 'Build ran out of ptys',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_INFRA,
},
{
message => 'Wrong arch detected',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_DETECT_WRONG_ARCH,
},
{
message => 'Wrong arch detected',
check => 0,
stop => 1,
+ analyze => 1,
type => ERR_DETECT_WRONG_ARCH,
},
{
message => 'Wrong arch detected',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_DETECT_WRONG_ARCH,
},
{
message => 'Alignment problem',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_CRASH,
},
{
message => 'Segmentation fault when installing RESULT',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_CRASH,
},
{
message => 'Segmentation fault',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_CRASH,
},
{
message => 'Illegal instruction when installing RESULT',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_CRASH,
},
{
message => 'Illegal instruction',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_CRASH,
},
{
message => 'Build-dep failed to install (RESULT)',
check => 1,
stop => 0,
+ analyze => 0,
type => ERR_BD_PROBLEM,
},
{
message => 'Pbuilder build-deps failed',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BD_PROBLEM,
},
{
message => 'Build-deps failed',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BD_PROBLEM,
},
{
message => 'Missing build-dep (RESULT)',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BD_PROBLEM,
},
{
message => 'Unsatisfiable build-dep conflict (RESULT)',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BD_PROBLEM,
},
{
message => 'Build-deps not satisfiable',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BD_PROBLEM,
},
{
message => 'dpkg-source failure',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure: missing library - missing build-dep?',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure: missing header - missing build-dep?',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure - missing build-dep?',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure (missing binary)',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure (java/javadoc)',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BUILD_PROBLEM,
},
{
# Build failed
- string => 'make.*returned exit code',
+ string => '^make.*\*\*\*.* \[debian/rules.*Error \d+$',
message => 'Build failure (other)',
check => 1,
- stop => 0,
+ stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
# Build failed
- string => '^make.*\*\*\*.* \[debian/rules.*Error \d+$',
+ string => 'make.*returned exit code',
message => 'Build failure (other)',
check => 1,
- stop => 1,
+ stop => 0,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure (other)',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure (clean failed)',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure (install failed)',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure (configure failed)',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure (RESULT)',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build error (RESULT)',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build error (RESULT)',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Build failure (other)',
check => 0,
stop => 1,
+ analyze => 1,
type => ERR_BUILD_PROBLEM,
},
{
message => 'Python EPERM test failure',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_TEST_PROBLEM,
},
{
message => 'Test failure',
check => 1,
stop => 1,
+ analyze => 1,
type => ERR_TEST_PROBLEM,
},
{
message => 'Pbuilder build timeout',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BUILD_TIMEOUT,
},
{
message => 'Sbuild build timeout',
check => 1,
stop => 1,
+ analyze => 0,
type => ERR_BUILD_TIMEOUT,
},
);
my %log_results;
+my %udd;
#foreach my $checktmp (@logcheck) {
# my %check = %$checktmp;
print "<h2>Packages</h2>\n";
print "<ol>\n";
+my $line;
+
+our($opt_u);
+getopts('u:') or die "getopts failure\n";
+
+if (defined $opt_u) {
+ open (UDD, "< $opt_u") or die "Can't open UDD list file $opt_u for reading\n";
+ while (defined ($line = <UDD>)) {
+ chomp $line;
+ my ($pkg, $bugno, $bugsubj) = split (/ /, $line, 3);
+ my @buglist;
+ my $tmp = $udd{"$pkg"};
+ if ($tmp) {
+ @buglist = @$tmp;
+ }
+ push (@buglist, "$bugno: $bugsubj");
+ $udd{"$pkg"} = \@buglist;
+ }
+ close UDD;
+
+# foreach my $key (keys %udd) {
+# my $tmp = $udd{$key};
+# my $num = scalar (@$tmp);
+# print "$key has $num bugs:\n";
+# foreach my $entry (@$tmp) {
+# print " $entry\n";
+# }
+# }
+}
+
foreach my $input (@ARGV) {
open (IN, "< $input") or die "Can't read $input: $!\n";
$num_fail++;
my $stop = 0;
my $lineno = 0;
my $errors = 0;
+ my $errors_need_analysis = 0;
my $oldline = "";
my %file_results;
- print "<li>Looking at <a href=\"$input\">$input</a>:\n";
+ my $pav;
+ my $pkg;
+ my $arch;
+ my $version;
+
+ $pav = $input;
+ $pav =~ s,^.*/,,g;
+ $pav =~ s,\.log,,g;
+ ($pkg, $version, $arch) = split (/_/, $pav);
+
+ print "<li>Looking at <a href=\"$input\">$pkg version $version on arch $arch</a>:\n";
print "<ul>\n";
- while (defined (my $line = <IN>) and !$stop) {
+ while (defined ($line = <IN>) and !$stop) {
$lineno++;
$lines_read++;
foreach my $checktmp (@logcheck) {
print " <li>Line $lineno: $message\n";
$errors++;
}
+ if ($check{analyze}) {
+ $errors_need_analysis++;
+ }
if ($check{stop}) {
# print " stopping processing\n";
$stop = 1;
print " <li>$line\n";
}
close IN;
+ } else {
+ if ($errors_need_analysis) {
+ print " <li><strong>Needs analysis</strong>\n";
+ if ($udd{$pkg}) {
+ my $tmp = $udd{$pkg};
+ my $num = scalar (@$tmp);
+ print " <li>$num reported FTBFS bugs:\n";
+ print " <ul>\n";
+ foreach my $entry (@$tmp) {
+ print " <li>#$entry\n";
+ }
+ print " </ul>\n";
+ }
+ }
}
print "</ul>\n";
$log_results{$file_results{$key}}{$key} += 1;
# print "now have $log_results{$key} for \"$key\"\n";
}
+ if ($errors_need_analysis) {
+ $awaiting_analysis++;
+ }
}
print "</ol>\n";
print "<a name=\"summary\"</a>\n";
print "<h2>Summary of results from $num_fail failed builds:</h2>\n";
+print "<p>$awaiting_analysis logs still need analysis</p>\n";
print "<ul>\n";
-print "<li> Found $existing_bugs existing bugs in the Debian BTS</li>\n";
+print " <li>Found $existing_bugs existing bugs in the Debian BTS</li>\n";
foreach my $type (sort keys %log_results) {
print " <h3>$err_descriptions[$type]</h3>\n";
my $tmp = $log_results{$type};