#! /usr/bin/perl
-
+#
+# analyze_results
+#
# Script to analyze failed build logs. Look for specific regexps to
# classify things
+#
+#
+# (c) 2018 Steve McIntyre <steve@einval.com> GPL v2+
use strict;
use warnings;
+use POSIX qw(strftime);
use Data::Dumper;
-my $logs = "/home/build/logs";
-my $logs_fail = "$logs/FAIL";
+my $name = "analyze_results";
+my $repo = "https://git.einval.com/cgi-bin/gitweb.cgi?p=buildd-scripts.git";
+my $hostname;
+my $date;
+my $time_start = time();
+my $time_end;
+my $time_taken;
my $num_fail = 0;
+my $lines_read = 0;
my $existing_bugs = 0;
+
use constant {
ERR_ARCH_MISMATCH => 1,
ERR_INFRA => 2,
print "<ul>\n";
while (defined (my $line = <IN>) and !$stop) {
$lineno++;
+ $lines_read++;
foreach my $checktmp (@logcheck) {
my %check = %$checktmp;
if ($check{check}) {
}
}
print "</ul>\n";
+
+$time_end = time();
+$time_taken = $time_end - $time_start;
+$date = strftime "%a %b %e %H:%M:%S %Z %Y", localtime;
+$hostname = `hostname`;
+
+print "<hr>\n";
+print "<p>Log analysis generated on $hostname, $date.\n";
+print "<br>Output from $name - see <a href=\"$repo\">$repo</a> for source.\n";
+print "<br>Read $lines_read lines of logs and took $time_taken seconds to complete.\n";
+
print "</body>\n";
print "</html>\n";