[Collab-qa-commits] r1586 - udd/web/cgi-bin

Lucas Nussbaum lucas at alioth.debian.org
Wed Sep 23 20:59:41 UTC 2009


Author: lucas
Date: 2009-09-23 20:59:41 +0000 (Wed, 23 Sep 2009)
New Revision: 1586

Added:
   udd/web/cgi-bin/bugs-binpkgs-pts.cgi
Log:
also generate list of bugs for binary packages

Added: udd/web/cgi-bin/bugs-binpkgs-pts.cgi
===================================================================
--- udd/web/cgi-bin/bugs-binpkgs-pts.cgi	                        (rev 0)
+++ udd/web/cgi-bin/bugs-binpkgs-pts.cgi	2009-09-23 20:59:41 UTC (rev 1586)
@@ -0,0 +1,53 @@
+#!/usr/bin/ruby -w
+
+# Used by DDPO and the PTS
+
+require 'dbi'
+
+puts "Content-type: text/plain\n\n"
+
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+
+COMQ = "select bugs_packages.package, count(*) as cnt from bugs, bugs_packages where bugs.id = bugs_packages.id and status != 'done'"
+NOPEND = "and bugs.id not in (select id from bugs_tags where tag in ('pending','fixed'))"
+ENDQ = "group by bugs_packages.package"
+
+rc_m = Hash::new { 0 }
+sth = dbh.prepare("#{COMQ} #{NOPEND} and severity >= 'serious' #{ENDQ}")
+sth.execute
+sth.fetch_all.each { |r| rc_m[r['package']] = r['cnt'] }
+sth.finish
+
+ino_m = Hash::new { 0 }
+sth = dbh.prepare("#{COMQ} #{NOPEND} and severity in ('important','normal') #{ENDQ}")
+sth.execute
+sth.fetch_all.each { |r| ino_m[r['package']] = r['cnt'] }
+sth.finish
+
+mw_m = Hash::new { 0 }
+sth = dbh.prepare("#{COMQ} #{NOPEND} and severity in ('minor','wishlist') #{ENDQ}")
+sth.execute
+sth.fetch_all.each { |r| mw_m[r['package']] = r['cnt'] }
+sth.finish
+
+fp_m = Hash::new { 0 }
+sth = dbh.prepare("#{COMQ} and bugs.id in (select id from bugs_tags where tag in ('pending','fixed')) #{ENDQ}")
+sth.execute
+sth.fetch_all.each { |r| fp_m[r['package']] = r['cnt'] }
+sth.finish
+
+patch_m = Hash::new { 0 }
+sth = dbh.prepare("#{COMQ} #{NOPEND} and bugs.id in (select id from bugs_tags where tag = 'patch') and bugs.id not in (select id from bugs_tags where tag = 'wontfix') #{ENDQ}")
+sth.execute
+sth.fetch_all.each { |r| patch_m[r['package']] = r['cnt'] }
+sth.finish
+
+pkgs = (rc_m.keys + ino_m.keys + mw_m.keys + fp_m.keys + patch_m.keys).uniq.sort
+pkgs.each do |pkg|
+  print "#{pkg} "
+  print "#{rc_m[pkg]} "
+  print "#{ino_m[pkg]} "
+  print "#{mw_m[pkg]} "
+  print "#{fp_m[pkg]} "
+  puts "#{patch_m[pkg]}"
+end


Property changes on: udd/web/cgi-bin/bugs-binpkgs-pts.cgi
___________________________________________________________________
Added: svn:executable
   + *




More information about the Collab-qa-commits mailing list