Author: neronus-guest
Date: 2008-08-02 18:29:22 +0000 (Sat, 02 Aug 2008)
New Revision: 977

Added:
   udd/web/cgi-bin/package_bug_count.cgi
   udd/web/cgi-bin/package_rc_bug_count.cgi
Log:
Added two queries for udd.debian.net:
 * the number of bugs per package
 * the number of RC bugs per package


Added: udd/web/cgi-bin/package_bug_count.cgi
===================================================================
--- udd/web/cgi-bin/package_bug_count.cgi                               (rev 0)
+++ udd/web/cgi-bin/package_bug_count.cgi       2008-08-02 18:29:22 UTC (rev 
977)
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -T
+
+use strict;
+use warnings;
+
+use DBI;
+use CGI;
+
+my $dbh = DBI->connect("dbi:Pg:dbname=udd") or die $!;
+my $sth = $dbh->prepare(<<EOF
+       SELECT package, COUNT(id) AS nr FROM bugs WHERE NOT is_archived AND NOT 
tags LIKE '%fixed%' AND (affects_stable OR affects_testing OR affects_unstable) 
GROUP BY package ORDER BY nr DESC
+EOF
+       );
+
+$sth->execute() or die $!;
+
+my $q = CGI->new();
+
+print $q->header(-type => 'text/plain');
+while(my @row = $sth->fetchrow_array) {
+       my ($package, $score) = @row;
+       print "$package\t$score\n";
+}
+


Property changes on: udd/web/cgi-bin/package_bug_count.cgi
___________________________________________________________________
Name: svn:executable
   + *

Added: udd/web/cgi-bin/package_rc_bug_count.cgi
===================================================================
--- udd/web/cgi-bin/package_rc_bug_count.cgi                            (rev 0)
+++ udd/web/cgi-bin/package_rc_bug_count.cgi    2008-08-02 18:29:22 UTC (rev 
977)
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -T
+
+use strict;
+use warnings;
+
+use DBI;
+use CGI;
+
+my $dbh = DBI->connect("dbi:Pg:dbname=udd") or die $!;
+my $sth = $dbh->prepare(<<EOF
+       SELECT package, COUNT(id) as nr FROM bugs WHERE severity in 
('critical', 'grave', 'serious') AND affects_testing AND NOT tags LIKE 
'%fixed%' AND NOT tags LIKE '%lenny-ignore%' AND NOT is_archived AND EXISTS 
(SELECT * FROM packages WHERE packages.package = package AND packages.release = 
'etch') GROUP BY package ORDER BY nr DESC;
+EOF
+       );
+
+$sth->execute() or die $!;
+
+my $q = CGI->new();
+
+print $q->header(-type => 'text/plain');
+while(my @row = $sth->fetchrow_array) {
+       my ($package, $score) = @row;
+       print "$package\t$score\n";
+}
+


Property changes on: udd/web/cgi-bin/package_rc_bug_count.cgi
___________________________________________________________________
Name: svn:executable
   + *


_______________________________________________
Collab-qa-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/collab-qa-commits

Reply via email to