building and testing packages
[packaging-tutorial.git] / update-cdbs-dh7.rb
1 #!/usr/bin/ruby -w
2
3 require 'date'
4
5 system("scp lintian.debian.org:~cjwatson/dhstats.txt .")
6 f = File::new("cdbs-dh7.txt", 'w')
7 f.puts "date dh dh7 cdbs"
8 IO::read("dhstats.txt").split(/\n\n/).each do |par|
9   par.strip!
10   next if par == "Sun Sep 20 00:29:01 UTC 2009"
11   lines = par.split(/\n/)
12   date = Date::parse(lines[0]).to_s
13   dh = lines.grep(/^debhelper: /)[0].split[2].gsub(/[\(\)\%]/,'').to_f
14   dh7 = lines.grep(/^dh\(1\): /)[0].split[2].gsub(/[\(\)\%]/,'').to_f
15   cdbs = lines.grep(/^CDBS: /)[0].split[2].gsub(/[\(\)\%]/,'').to_f
16   f.puts "#{date} #{dh - dh7 - cdbs} #{dh7} #{cdbs}"
17 end
18 f.close
19 system("rm dhstats.txt")