Browse files

Do a smarter match on the lines to split warnings and errors.

  • Loading branch information...
1 parent 93563ad commit 12b1e26a9bcb5df8329ab80b519eff40de83af21 @Flameeyes Flameeyes committed Jun 17, 2012
Showing with 20 additions and 4 deletions.
  1. +20 −4 readscript.rb
View
24 readscript.rb
@@ -21,7 +21,7 @@
require 'archive/tar/minitar'
require 'builder'
-match = Regexp.new("( .*\\*.* ERROR: .*failed|detected file collision|Tinderbox QA Warning!|QA Notice: (Pre-stripped|file does not exist|command not found|USE flag|Files built without respecting LDFLAGS|The following files)|linux_config_exists|will always overflow|called with bigger|maintainer mode detected|econf called in src_compile)")
+warnings = Regexp.new("(Tinderbox QA Warning!|QA Notice: (Pre-stripped|file does not exist|command not found|USE flag|Files built without respecting LDFLAGS|The following files)|linux_config_exists|will always overflow|called with bigger|maintainer mode detected|econf called in src_compile)")
config = IniFile.new("./tboxanalysis.ini")
@@ -55,6 +55,8 @@
Archive::Tar::Minitar::Reader.open(sock) do |input|
input.each do |log|
matches = 0
+ pkg_failed = false
+ test_failed = false
next unless log.file?
@@ -73,11 +75,23 @@
xml_builder.body {
xml_builder.ol {
log.read.split("\n").each do |line|
- if line =~ match
- xml_builder.li line, :class => "match"
+ match = false
+
+ if line =~ warnings
+ match = true
+ elsif line =~ /^ \* ERROR: .* failed \(test phase\):/
+ test_failed = true
+ match = true
+ elsif line =~ /(^ \* ERROR: .* failed|detected file collision)/
+ pkg_failed = true
+ match = true
+ end
+
+ if match
matches += 1
+ xml_builder.li(line, :class => "match")
else
- xml_builder.li line
+ xml_builder.li(line)
end
end
}
@@ -101,6 +115,8 @@
:pkg => pkg_name,
:date => date_time,
:matches => matches,
+ :pkg_failed => pkg_failed,
+ :test_failed => test_failed,
:public_url => html_log.public_url);
end
end

0 comments on commit 12b1e26

Please sign in to comment.