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

Lucas Nussbaum lucas at alioth.debian.org
Mon Sep 13 09:15:28 UTC 2010


Author: lucas
Date: 2010-09-13 09:15:26 +0000 (Mon, 13 Sep 2010)
New Revision: 1785

Added:
   udd/web/cgi-bin/last-uploads-dd.cgi
   udd/web/cgi-bin/last-uploads.cgi
   udd/web/cgi-bin/new-maintainers.cgi
Log:
various upload history CGIs

Added: udd/web/cgi-bin/last-uploads-dd.cgi
===================================================================
--- udd/web/cgi-bin/last-uploads-dd.cgi	                        (rev 0)
+++ udd/web/cgi-bin/last-uploads-dd.cgi	2010-09-13 09:15:26 UTC (rev 1785)
@@ -0,0 +1,54 @@
+#!/usr/bin/ruby -w
+
+require 'dbi'
+require 'pp'
+
+puts "Content-type: text/html\n\n"
+
+puts <<-EOF
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<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>Latest uploads for Debian Developers</title>
+</head>
+<body>
+EOF
+
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+
+q = "
+select login, max(date) as date
+from upload_history, carnivore_keys, carnivore_login
+where upload_history.fingerprint = carnivore_keys.key
+and carnivore_keys.id = carnivore_login.id
+group by login
+order by date desc;
+"
+sth = dbh.prepare(q)
+sth.execute ; rows = sth.fetch_all
+puts "<h2>Latest uploads for Debian Developers</h2>"
+puts "(Looking at keys used by DDs to sign uploads)"
+
+puts "<table>"
+puts "<tr><th></th><th>date</th><th>login</th></tr>"
+n = 1
+rows.each do |r|
+  puts "<tr><td>#{n}</td><td>#{r['date']}</td><td>#{r['login']}</td></tr>"
+  n+=1
+end
+puts "</table>"
+sth.finish
+puts "Query:<br><pre>#{q}</pre>"


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

Added: udd/web/cgi-bin/last-uploads.cgi
===================================================================
--- udd/web/cgi-bin/last-uploads.cgi	                        (rev 0)
+++ udd/web/cgi-bin/last-uploads.cgi	2010-09-13 09:15:26 UTC (rev 1785)
@@ -0,0 +1,52 @@
+#!/usr/bin/ruby -w
+
+require 'dbi'
+require 'pp'
+
+puts "Content-type: text/html\n\n"
+
+puts <<-EOF
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<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>Latest uploads for Debian developers</title>
+</head>
+<body>
+EOF
+
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+
+q = "
+select changed_by_email, changed_by_name, date, source, version from upload_history
+where (changed_by_name, changed_by_email, date) in (
+select changed_by_name, changed_by_email, max(date)
+from upload_history
+group by changed_by_name, changed_by_email)
+order by date desc;
+"
+sth = dbh.prepare(q)
+sth.execute ; rows = sth.fetch_all
+puts "<h2>Latest uploads for Debian developers</h2>"
+puts "(Looking at Changed-By: only, so developers can appear more than once if they changed the email they are using for Debian work)"
+
+puts "<table>"
+puts "<tr><th>date</th><th>uploader</th><th>package</th></tr>"
+rows.each do |r|
+  puts "<tr><td>#{r['date'].to_s.split(' ')[0]}</td><td>#{r['changed_by_name']} &lt;#{r['changed_by_email']}&gt;</td><td>#{r['source']} #{r['version']}</td></tr>"
+end
+puts "</table>"
+sth.finish
+puts "Query:<br><pre>#{q}</pre>"


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

Added: udd/web/cgi-bin/new-maintainers.cgi
===================================================================
--- udd/web/cgi-bin/new-maintainers.cgi	                        (rev 0)
+++ udd/web/cgi-bin/new-maintainers.cgi	2010-09-13 09:15:26 UTC (rev 1785)
@@ -0,0 +1,57 @@
+#!/usr/bin/ruby -w
+
+require 'dbi'
+require 'pp'
+
+puts "Content-type: text/html\n\n"
+
+puts <<-EOF
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<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>New debian maintainers</title>
+</head>
+<body>
+EOF
+
+dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
+
+q = "
+select changed_by_email, changed_by_name, date, source, version, login from
+(select changed_by_email, changed_by_name, date, source, version, fingerprint from upload_history
+where (changed_by_name, changed_by_email, date) in (
+select changed_by_name, changed_by_email, min(date)
+from upload_history
+group by changed_by_name, changed_by_email)
+) uploads
+LEFT JOIN (select distinct key, login from carnivore_keys, carnivore_login where carnivore_keys.id = carnivore_login.id) carn ON uploads.fingerprint = carn.key
+where (changed_by_email, login) not in (select email, login from carnivore_emails, carnivore_login where carnivore_emails.id = carnivore_login.id)
+order by date desc;
+"
+sth = dbh.prepare(q)
+sth.execute ; rows = sth.fetch_all
+puts "<h2>New Debian maintainers</h2>"
+puts "This page lists the first upload of each maintainer (identified by his name and email), together with its sponsor."
+
+
+puts "<table>"
+puts "<tr><th>date</th><th>maintainer</th><th>package</th><th>sponsor</th></tr>"
+rows.each do |r|
+  puts "<tr><td>#{r['date'].to_s.split(' ')[0]}</td><td>#{r['changed_by_name']} &lt;#{r['changed_by_email']}&gt;</td><td>#{r['source']} #{r['version']}</td><td>#{r['login']}</td></tr>"
+end
+puts "</table>"
+sth.finish
+puts "Query:<br><pre>#{q}</pre>"


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




More information about the Collab-qa-commits mailing list