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

Lucas Nussbaum lucas at alioth.debian.org
Mon Dec 21 18:04:06 UTC 2009


Author: lucas
Date: 2009-12-21 18:03:25 +0000 (Mon, 21 Dec 2009)
New Revision: 1646

Added:
   udd/web/cgi-bin/sources_sid_filtered.cgi
   udd/web/cgi-bin/ubuntu_ftbfs.cgi
   udd/web/cgi-bin/ubuntu_old_packages.cgi
Log:
more cgis

Added: udd/web/cgi-bin/sources_sid_filtered.cgi
===================================================================
--- udd/web/cgi-bin/sources_sid_filtered.cgi	                        (rev 0)
+++ udd/web/cgi-bin/sources_sid_filtered.cgi	2009-12-21 18:03:25 UTC (rev 1646)
@@ -0,0 +1,15 @@
+#!/usr/bin/ruby -w
+# Used by Harvest at Ubuntu
+
+require 'dbi'
+
+puts "Content-type: text/plain\n\n"
+
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+sth = dbh.prepare("select source, version, component
+from sources_uniq where distribution='debian' and release='sid' order by source")
+sth.execute
+while row = sth.fetch do
+  puts "#{row['source']} #{row['version']} #{row['component']}"
+end
+sth.finish


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

Added: udd/web/cgi-bin/ubuntu_ftbfs.cgi
===================================================================
--- udd/web/cgi-bin/ubuntu_ftbfs.cgi	                        (rev 0)
+++ udd/web/cgi-bin/ubuntu_ftbfs.cgi	2009-12-21 18:03:25 UTC (rev 1646)
@@ -0,0 +1,120 @@
+#!/usr/bin/ruby -w
+
+require 'dbi'
+require 'pp'
+require 'uri'
+require 'net/http'
+
+puts "Content-type: text/html\n\n"
+
+puts <<-EOF
+<html>
+<head>
+<style type="text/css">
+  td, th {
+    border: 1px solid gray;
+    padding-left: 3px;
+    padding-right: 3px;
+  }
+  tr:hover  {
+    background-color: #ccc;
+  }
+  table {
+    border-collapse: collapse;
+  }
+</style>
+<title>Ubuntu FTBFS</title>
+</head>
+<body>
+<h1>Ubuntu packages that FTBFS</h1>
+
+Contact: <a href="mailto: lucas at ubuntu.com">Lucas Nussbaum</a><br>
+EOF
+
+STDOUT.flush
+
+res32 = Net::HTTP.get(URI::parse('http://people.ubuntuwire.com/~lucas/ubuntu-nbs/res.lucid.32')).split(/\n/)
+res64 = Net::HTTP.get(URI::parse('http://people.ubuntuwire.com/~lucas/ubuntu-nbs/res.lucid.64')).split(/\n/)
+
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+
+sth = dbh.prepare("select u.source, u.version, u.component, d.version as dversion, d.version > u.version as vercmp from ubuntu_sources u LEFT JOIN (SELECT source, version from sources_uniq where distribution='debian' and release='sid') d on (u.source = d.source) where u.distribution='ubuntu' and u.release='lucid' order by u.component, u.source")
+sth.execute ; rows_u = sth.fetch_all
+sth.finish
+
+fails = {}
+res32.each do |l|
+  pkg, v, res, reason = l.split(' ', 4)
+  fails[pkg] = {} if fails[pkg].nil?
+  fails[pkg]['32'] = [res, reason]
+  fails[pkg]['version'] = v
+end
+res64.each do |l|
+  pkg, v, res, reason = l.split(' ', 4)
+  fails[pkg] = {} if fails[pkg].nil?
+  fails[pkg]['64'] = [res, reason]
+  fails[pkg]['version'] = v
+end
+fails.delete_if { |k, v| (v['32'].nil? or v['32'][0] == 'OK') and (v['64'].nil? or v['64'][0] == 'OK') }
+
+puts "#{fails.length} packages failed to build.<br><br>"
+
+outdatedres = []
+puts "<table>"
+puts "<tr><th>Package</th><th>Section</th><th>Newer in Debian</th><th>i386</th><th>amd64</th><th>Reason</th></tr>"
+
+def showrow(r, fa)
+  puts "<tr><td>#{r['source']} #{fa['version']} 
+  <a href=\"http://packages.qa.debian.org/#{r['source']}\">PTS</a>
+  <a href=\"http://bugs.debian.org/src:#{r['source']}\">BTS</a>
+  <a href=\"https://launchpad.net/ubuntu/+source/#{r['source']}\">LP</a>
+  </td><td>#{r['component']}</td>"
+  if r['dversion'].nil?
+    puts "<td>Not in Debian</td>"
+  elsif r['vercmp']
+    puts "<td>Yes</td>"
+  else
+    puts "<td>No</td>"
+  end
+  ['32','64'].each do |a|
+    if fa[a].nil?
+      puts "<td>N/A</td>"
+    else
+      puts "<td><a href=\"http://people.ubuntuwire.org/~lucas/ubuntu-nbs/#{a}/#{r['source']}_#{fa['version']}_llucid#{a}.buildlog\">#{fa[a][0]}</a></td>"
+    end
+  end
+  if fa['32'].nil? or fa['32'][0] == 'OK' # only amd64 failed
+    puts "<td>#{fa['64'][1]}</td>"
+  elsif fa['64'].nil? or fa['64'][0] == 'OK' # only i386 failed
+    puts "<td>#{fa['32'][1]}</td>"
+  elsif fa['32'][1] == fa['64'][1] # both failed with the same message
+    puts "<td>#{fa['64'][1]}</td>"
+  else
+    puts "<td>i386: #{fa['32'][1]}<br>amd64: #{fa['64'][1]}</td>"
+  end
+  puts "</tr>"
+end
+
+rows_u.each do |r|
+  fa = fails[r['source']]
+  next if fa == nil
+  if r['version'] != fa['version']
+    outdatedres << r
+    next
+  end
+  showrow(r, fa)
+end
+puts "</table>"
+# FIXME outdatedres
+
+puts "<h2>Outdated results</h2>"
+puts "Those test builds were done with a version of the package that was superseded by a newer version in lucid.<br><br>"
+puts "<table>"
+puts "<tr><th>Package</th><th>Section</th><th>Newer in Debian</th><th>i386</th><th>amd64</th><th>Reason</th></tr>"
+outdatedres.each do |r|
+  fa = fails[r['source']]
+  showrow(r, fa)
+end
+puts "</table>"
+puts "</body>"
+puts "</html>"


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

Added: udd/web/cgi-bin/ubuntu_old_packages.cgi
===================================================================
--- udd/web/cgi-bin/ubuntu_old_packages.cgi	                        (rev 0)
+++ udd/web/cgi-bin/ubuntu_old_packages.cgi	2009-12-21 18:03:25 UTC (rev 1646)
@@ -0,0 +1,53 @@
+#!/usr/bin/ruby -w
+# Used by DDPO
+
+require 'dbi'
+
+RELEASE='lucid'
+
+puts "Content-type: text/html\n\n"
+
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+sth = dbh.prepare("select insts from ubuntu_popcon_src where source='coreutils'")
+sth.execute
+popcon = sth.fetch_all[0][0]
+sth.finish
+puts "Popcon for coreutils: #{popcon}<br>"
+mpc = popcon/1000*100
+puts "0.2% of coreutils popcon: #{mpc}<br>"
+
+puts "### was in etch | lenny<br>"
+sth = dbh.prepare("select src1.source, src1.version, coalesce(insts, 0) insts
+from ubuntu_sources src1
+join ubuntu_sources src2 using (source, version)
+left join ubuntu_popcon_src popcon using (source)
+where src1.component in ('universe', 'multiverse')
+and src1.release='lucid' and src2.release='hardy'
+and src1.source not in
+  (select source from sources where release = 'sid')
+and src1.source in
+  (select source from sources where release in ('etch','lenny'))
+and insts < #{mpc}
+order by insts asc")
+sth.execute
+sth.fetch_all.each do |r|
+  puts "<a href=\"http://packages.ubuntu.com/search?searchon=sourcenames&keywords=#{r['source']}\">#{r['source']}</a> #{r['version']} #{r['insts']} <a href=\"http://packages.qa.debian.org/#{r['source']}\">PTS</a><br>"
+end
+
+puts "### was NOT in etch | lenny<br>"
+sth = dbh.prepare("select src1.source, src1.version, coalesce(insts, 0) insts
+from ubuntu_sources src1
+join ubuntu_sources src2 using (source, version)
+left join ubuntu_popcon_src popcon using (source)
+where src1.component in ('universe', 'multiverse')
+and src1.release='lucid' and src2.release='hardy'
+and src1.source not in
+  (select source from sources where release = 'sid')
+and src1.source not in
+  (select source from sources where release in ('etch','lenny'))
+and insts < #{mpc}
+order by insts asc")
+sth.execute
+sth.fetch_all.each do |r|
+  puts "<a href=\"http://packages.ubuntu.com/search?searchon=sourcenames&keywords=#{r['source']}\">#{r['source']}</a> #{r['version']} #{r['insts']} <a href=\"http://packages.qa.debian.org/#{r['source']}\">PTS</a><br>"
+end


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




More information about the Collab-qa-commits mailing list