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

neronus-guest at alioth.debian.org neronus-guest at alioth.debian.org
Sat Aug 2 18:29:22 UTC 2008


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
   + *




More information about the Collab-qa-commits mailing list