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

Sandro Tosi morph at alioth.debian.org
Fri Sep 18 19:59:45 UTC 2009


Author: morph
Date: 2009-09-18 19:59:45 +0000 (Fri, 18 Sep 2009)
New Revision: 1581

Added:
   udd/web/cgi-bin/source_in_ubuntu_but_not_in_debian.cgi
Log:
add CGI for packages in Ubuntu but not in Debian

Added: udd/web/cgi-bin/source_in_ubuntu_but_not_in_debian.cgi
===================================================================
--- udd/web/cgi-bin/source_in_ubuntu_but_not_in_debian.cgi	                        (rev 0)
+++ udd/web/cgi-bin/source_in_ubuntu_but_not_in_debian.cgi	2009-09-18 19:59:45 UTC (rev 1581)
@@ -0,0 +1,46 @@
+#!/usr/bin/python                                 
+#
+# Author:    Sandro Tosi <morph at debian.org>
+# Date:	     2009-09-18
+# Copyright: Copyright (C) 2009 Sandro Tosi <morph at debian.org>
+# License:   Public Domain
+#
+# Extract from UDD the source packages in Ubuntu but not in Debian
+
+# module to access PostgreSQL databases
+import psycopg2
+
+# connect to UDD database
+conn = psycopg2.connect(database="udd", port=5441, host="localhost", user="guest")
+
+# prepare a cursor                     
+cur = conn.cursor()                    
+
+# this is the query we'll be making
+query = """                        
+select source, max(version)
+  from ubuntu_sources
+ where source not in (select distinct source from sources)
+ group by source
+ order by 1"""
+
+# execute the query
+cur.execute(query)
+
+# retrieve the whole result set
+data = cur.fetchall()
+
+# close cursor and connection
+cur.close()
+conn.close()
+
+# print results
+
+# heading
+print "Source packages in Ubuntu but not in Debian\n"
+print "%35s %25s" % ('Source Package Name', 'Ubuntu Version')
+print "-"*61
+
+# actual data
+for row in data:
+    print "%35s %25s" % row


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




More information about the Collab-qa-commits mailing list