[Collab-qa-commits] r1450 - collab-qa-tools/lib/collab-qa
Lucas Nussbaum
lucas at alioth.debian.org
Fri May 8 20:05:23 UTC 2009
Author: lucas
Date: 2009-05-08 20:05:23 +0000 (Fri, 08 May 2009)
New Revision: 1450
Modified:
collab-qa-tools/lib/collab-qa/log-parser.rb
Log:
parse build time
Modified: collab-qa-tools/lib/collab-qa/log-parser.rb
===================================================================
--- collab-qa-tools/lib/collab-qa/log-parser.rb 2009-05-08 20:02:55 UTC (rev 1449)
+++ collab-qa-tools/lib/collab-qa/log-parser.rb 2009-05-08 20:05:23 UTC (rev 1450)
@@ -23,7 +23,7 @@
@lines = @data.split(/\n/)
@reasons, @sum_1l, @sum_ml, @extract = nil
@logtype = nil
- @package, @version, @result, @time = 'UNKNOWN'
+ @package, @version, @result, @time, @buildtime = 'UNKNOWN'
dbh = @lines.grep(/^DC-Build-Header:/)[0]
if dbh
@@ -37,6 +37,11 @@
@result = "Unknown"
@time = 0
end
+ dbn = @lines.grep(/^Build needed/)[0]
+ if dbn
+ b1, b2, t, rest = dbn.split(' ',4)
+ @buildtime = t.split(/:|,/).map { |i| i.to_i }.inject(0) { |a, b| a * 60 + b }
+ end
else
dph = @lines.grep(/^DC-Piuparts-Header:/)[0]
if dph
@@ -101,7 +106,7 @@
def oneline_to_s(disptime = false)
if disptime
- return "#{@package} #{@version} #{@result} #{@time} [#{reasons_to_s}] #{@sum_1l}\n"
+ return "#{@package} #{@version} #{@result} #{@time} #{@buildtime} [#{reasons_to_s}] #{@sum_1l}\n"
else
return "#{@package} #{@version} #{@result} [#{reasons_to_s}] #{@sum_1l}\n"
end
More information about the Collab-qa-commits
mailing list