[Collab-qa-commits] r2110 - in udd/web: . cgi-bin/attic

Lucas Nussbaum lucas at alioth.debian.org
Tue Dec 20 15:54:47 UTC 2011


Author: lucas
Date: 2011-12-20 15:54:47 +0000 (Tue, 20 Dec 2011)
New Revision: 2110

Added:
   udd/web/pts-release-goals.cgi
Modified:
   udd/web/cgi-bin/attic/ubuntu_stats.cgi
Log:
add pts-release-goals.cgi for 647258

Modified: udd/web/cgi-bin/attic/ubuntu_stats.cgi
===================================================================
--- udd/web/cgi-bin/attic/ubuntu_stats.cgi	2011-12-20 15:17:03 UTC (rev 2109)
+++ udd/web/cgi-bin/attic/ubuntu_stats.cgi	2011-12-20 15:54:47 UTC (rev 2110)
@@ -2,7 +2,7 @@
 
 require 'dbi'
 require 'pp'
-RELEASE='precise'
+RELEASE='oneiric'
 
 puts "Content-type: text/plain\n\n"
 
@@ -39,11 +39,11 @@
 sth.execute ; rows = sth.fetch_all
 pp getnums(rows)
 
-puts "Not Ubuntu specific, not in debian (not in lenny or sid):"
+puts "Not Ubuntu specific, not in debian (not in lenny or squeeze or wheezy or sid):"
 sth = dbh.prepare("select component, count(*) from ubuntu_sources where distribution = 'ubuntu' and release = '#{RELEASE}'
 AND source !~ '^language-(support|pack)-.*' AND source !~ '^kde-l10n-.*'
 AND source !~ 'ubuntu' AND source !~ 'launchpad'
-AND source not in (select source from sources where distribution='debian' and release in ('sid', 'lenny'))
+AND source not in (select source from sources where distribution='debian' and release in ('sid', 'wheezy', 'squeeze', 'lenny'))
  group by component")
 sth.execute ; rows = sth.fetch_all
 pp getnums(rows)
@@ -51,7 +51,7 @@
 puts "Also in debian, version ~ /ubuntu/:"
 sth = dbh.prepare("select component, count(*) from ubuntu_sources where distribution = 'ubuntu' and release = '#{RELEASE}'
 AND source !~ '^language-(support|pack)-.*' AND source !~ '^kde-l10n-.*' AND source !~ 'ubuntu' AND source !~ 'launchpad'
-AND source in (select source from sources where distribution='debian' and release in ('sid', 'lenny'))
+AND source in (select source from sources where distribution='debian' and release in ('sid', 'wheezy', 'squeeze', 'lenny'))
 AND version ~ 'ubuntu'
  group by component")
 sth.execute ; rows = sth.fetch_all
@@ -60,7 +60,7 @@
 puts "Also in Debian, diverged + new upstream (version ~ /-0ubuntu/):"
 sth = dbh.prepare("select component, count(*) from ubuntu_sources where distribution = 'ubuntu' and release = '#{RELEASE}'
 AND source !~ '^language-(support|pack)-.*' AND source !~ '^kde-l10n-.*' AND source !~ 'ubuntu' AND source !~ 'launchpad'
-AND source in (select source from sources where distribution='debian' and release in ('sid', 'lenny'))
+AND source in (select source from sources where distribution='debian' and release in ('sid', 'wheezy', 'squeeze', 'lenny'))
 AND version ~ '-0ubuntu'
  group by component")
 sth.execute ; rows = sth.fetch_all
@@ -69,7 +69,7 @@
 puts "Also in Debian, (version !~ /ubuntu/):"
 sth = dbh.prepare("select component, count(*) from ubuntu_sources where distribution = 'ubuntu' and release = '#{RELEASE}'
 AND source !~ '^language-(support|pack)-.*' AND source !~ '^kde-l10n-.*' AND source !~ 'ubuntu' AND source !~ 'launchpad'
-AND source in (select source from sources where distribution='debian' and release in ('sid', 'lenny'))
+AND source in (select source from sources where distribution='debian' and release in ('sid', 'wheezy', 'squeeze', 'lenny'))
 AND version !~ 'ubuntu'
  group by component")
 sth.execute ; rows = sth.fetch_all
@@ -79,7 +79,7 @@
 puts "diverged+new upstream (main):"
 sth = dbh.prepare("select source from ubuntu_sources where distribution = 'ubuntu' and release = '#{RELEASE}' and component = 'main'
 AND source !~ '^language-(support|pack)-.*' AND source !~ '^kde-l10n-.*' AND source !~ 'ubuntu' AND source !~ 'launchpad'
-AND source in (select source from sources where distribution='debian' and release in ('sid', 'lenny'))
+AND source in (select source from sources where distribution='debian' and release in ('sid', 'wheezy', 'squeeze', 'lenny'))
 AND version ~ '-0ubuntu' order by source")
 sth.execute ; rows = sth.fetch_all
 rows.each do |r|
@@ -91,7 +91,7 @@
 puts "diverged+new upstream (universe):"
 sth = dbh.prepare("select source from ubuntu_sources where distribution = 'ubuntu' and release = '#{RELEASE}' and component = 'universe'
 AND source !~ '^language-(support|pack)-.*' AND source !~ '^kde-l10n-.*' AND source !~ 'ubuntu' AND source !~ 'launchpad'
-AND source in (select source from sources where distribution='debian' and release in ('sid', 'lenny'))
+AND source in (select source from sources where distribution='debian' and release in ('sid', 'wheezy', 'squeeze', 'lenny'))
 AND version ~ '-0ubuntu' order by source")
 sth.execute ; rows = sth.fetch_all
 rows.each do |r|
@@ -104,7 +104,7 @@
 where u.distribution = 'ubuntu' and u.release = '#{RELEASE}' and u.component = 'main'
 and d.distribution = 'debian' and d.release = 'wheezy'
 AND u.source !~ '^language-(support|pack)-.*' AND u.source !~ '^kde-l10n-.*' AND u.source !~ 'ubuntu' AND u.source !~ 'launchpad'
-AND u.source in (select source from sources where distribution='debian' and release in ('sid', 'lenny'))
+AND u.source in (select source from sources where distribution='debian' and release in ('sid', 'wheezy', 'squeeze', 'lenny'))
 AND u.version ~ '-0ubuntu'
 AND u.source = d.source
 AND u.version > d.version
@@ -121,7 +121,7 @@
 where u.distribution = 'ubuntu' and u.release = '#{RELEASE}' and u.component = 'universe'
 and d.distribution = 'debian' and d.release = 'wheezy'
 AND u.source !~ '^language-(support|pack)-.*' AND u.source !~ '^kde-l10n-.*' AND u.source !~ 'ubuntu' AND u.source !~ 'launchpad'
-AND u.source in (select source from sources where distribution='debian' and release in ('sid', 'lenny'))
+AND u.source in (select source from sources where distribution='debian' and release in ('sid', 'wheezy', 'squeeze', 'lenny'))
 AND u.version ~ '-0ubuntu'
 AND u.source = d.source
 AND u.version > d.version

Added: udd/web/pts-release-goals.cgi
===================================================================
--- udd/web/pts-release-goals.cgi	                        (rev 0)
+++ udd/web/pts-release-goals.cgi	2011-12-20 15:54:47 UTC (rev 2110)
@@ -0,0 +1,36 @@
+#!/usr/bin/ruby -w
+
+# See #647258
+
+require 'dbi'
+require 'pp'
+require 'cgi'
+require 'time'
+require 'yaml'
+require 'json'
+require 'net/http'
+puts "Content-type: text/yaml\n\n"
+
+rgs = Net::HTTP::get(URI("http://release.debian.org/testing/goals.yaml"))
+rgs = YAML::load(rgs)
+rgs = rgs['release-goals']
+# only rgs that are not rejected or proposed
+rgs = rgs.select { |rg| rg['state'] != 'rejected' }
+rgs = rgs.select { |rg| rg['state'] != 'proposed' }
+# only rgs that have associated usertags
+rgs = rgs.select { |rg| rg['bugs'] != nil }
+usertags = []
+rgs.each do |rg|
+  rg['bugs']['usertags'].each do |ut|
+    usertags << [ rg['bugs']['user'], ut ]
+  end
+end
+ut_text = usertags.map { |e| "('#{e[0]}', '#{e[1]}')"}.join(',')
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+dbh.execute("SET statement_timeout TO 90000")
+q = "select bugs.id, bugs.source, bugs.package, bu.email, bu.tag from bugs, bugs_usertags bu where bugs.id = bu.id and status = 'pending' and (bu.email, bu.tag) in (#{ut_text})"
+sth = dbh.prepare(q)
+sth.execute
+rows = sth.fetch_all
+rows = rows.map { |r| r.to_h }
+puts YAML::dump(rows)


Property changes on: udd/web/pts-release-goals.cgi
___________________________________________________________________
Added: svn:executable
   + *




More information about the Collab-qa-commits mailing list