[med-svn] r1256 - in trunk/community/infrastructure: . test
tille at alioth.debian.org
tille at alioth.debian.org
Fri Feb 1 18:28:02 UTC 2008
Author: tille
Date: 2008-02-01 18:28:02 +0000 (Fri, 01 Feb 2008)
New Revision: 1256
Added:
trunk/community/infrastructure/test/
trunk/community/infrastructure/test/update-tasks_using_python-debian
Log:
Simple test of python-debian whether it might whether it might be more usefull for update-tasks regarding specifying the target distribution.
Added: trunk/community/infrastructure/test/update-tasks_using_python-debian
===================================================================
--- trunk/community/infrastructure/test/update-tasks_using_python-debian (rev 0)
+++ trunk/community/infrastructure/test/update-tasks_using_python-debian 2008-02-01 18:28:02 UTC (rev 1256)
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+
+# grep the names of all Debian native packages out of Sources files
+# Copyright (C) 2007 Stefano Zacchiroli <zack at debian.org>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+import sys
+import urllib
+import StringIO
+import gzip
+
+BASEURL='http://ftp.debian.de/debian/dists/'
+DIST='unstable'
+
+from debian_bundle import deb822
+
+
+for component in ('main', 'contrib', 'non-free' ):
+ f = urllib.urlopen(BASEURL+'/'+DIST+'/'+component+'/binary-i386/Packages.gz')
+ compresseddata = f.read()
+ compressedstream = StringIO.StringIO(compresseddata)
+ g = gzip.GzipFile(fileobj=compressedstream)
+ for stanza in deb822.Sources.iter_paragraphs(g, shared_storage=False):
+ pieces = stanza['version'].split('-')
+ description = stanza['description'].split('\n')
+ if len(pieces) < 2:
+ print stanza['package'] + ':' + description[0]
+ f.close()
+
Property changes on: trunk/community/infrastructure/test/update-tasks_using_python-debian
___________________________________________________________________
Name: svn:executable
+ *
More information about the debian-med-commit
mailing list