| 1 |
#!/usr/bin/ruby -w
|
| 2 |
|
| 3 |
class Result
|
| 4 |
attr_accessor :version, :result, :time, :guess, :explanation
|
| 5 |
def to_s
|
| 6 |
"#{@version} #{@result} #{@time} #{@guess} #{@explanation}"
|
| 7 |
end
|
| 8 |
end
|
| 9 |
|
| 10 |
previous = {}
|
| 11 |
IO::read(ARGV[0]).each_line do |l|
|
| 12 |
l.chomp!
|
| 13 |
r = Result::new
|
| 14 |
p, r.version, r.result, r.time, r.guess, r.explanation = l.split(' ', 6)
|
| 15 |
if r.explanation.nil?
|
| 16 |
r.explanation = ""
|
| 17 |
end
|
| 18 |
# cleanup old explanations
|
| 19 |
r.explanation.gsub!(/ NEWFAIL$/ ,'')
|
| 20 |
previous[p] = r
|
| 21 |
end
|
| 22 |
|
| 23 |
IO::read(ARGV[1]).each_line do |l|
|
| 24 |
l.chomp!
|
| 25 |
r = Result::new
|
| 26 |
pkg, r.version, r.result, r.time, r.guess, r.explanation = l.split(' ', 6)
|
| 27 |
if r.explanation == "TODO" or r.explanation == "TODO NEWFAIL"
|
| 28 |
if previous[pkg] and previous[pkg].result == r.result and previous[pkg].explanation !~ /^TODO/
|
| 29 |
pr = previous[pkg]
|
| 30 |
r.explanation += " S/"
|
| 31 |
r.explanation += "V" if pr.version == r.version
|
| 32 |
r.explanation += "G" if pr.guess == r.guess
|
| 33 |
r.explanation += "/" + pr.explanation
|
| 34 |
end
|
| 35 |
end
|
| 36 |
puts "#{pkg} #{r}"
|
| 37 |
end
|