Add support for logging some of what was matched in our scan
authorSteve McIntyre <steve@einval.com>
Thu, 25 Oct 2018 14:20:30 +0000 (15:20 +0100)
committerSteve McIntyre <steve@einval.com>
Thu, 25 Oct 2018 14:20:30 +0000 (15:20 +0100)
Rather than just "build-deps failed", say what was missing if we can
work it out.

bin/analyze_results

index 78faecb..1902d59 100755 (executable)
@@ -135,9 +135,8 @@ my @logcheck = (
     },
     {
        # Installing build-deps failed
-       string   => 'unsat-dependency:',
-       pstring  => '.*',
-       message  => 'build-deps failed',
+       string   => 'unsat-dependency: (.*)',
+       message  => 'build-deps failed (RESULT)',
        check    => 1,
        stop     => 1,
        timeout  => 0, # This is a real error, not a build timeout
@@ -293,12 +292,15 @@ foreach my $input (@ARGV) {
                    and ($line =~ m/$check{string}/)
                    and (!$check{pstring} or $oldline =~ m/$check{pstring}/)) {
 #                  print "  Line $lineno: found \"$check{string}\"\n";
-                   $file_results{$check{message}} = 1;
+                   my $match = $1;
+                   my $message = $check{message};
+                   $message =~ s,RESULT,$match,g;
+                   $file_results{$message} = 1;
                    if ($check{timeout} and $errors == 0) {
-                       print "  <li>Line $lineno: $check{message}\n";
+                       print "  <li>Line $lineno: $message\n";
                        print "  <li>Build killed by timeout before any errors at line $lineno\n";
                    } else {
-                       print "  <li>Line $lineno: $check{message}\n";
+                       print "  <li>Line $lineno: $message\n";
                        $errors++;
                    }
                    if ($check{stop}) {