4 Prints out, for every file in the pool, which source package and version it
5 belongs to and for binary packages additionally which arch, binary package
6 and binary package version it has in a standard rfc2822-like format.
8 @contact: Debian FTP Master <ftpmaster@debian.org>
9 @copyright: 2009 Peter Palfrader <peter@palfrader.org>
10 @license: GNU General Public License version 2 or later
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 ################################################################################
30 # <arma> it's crypto -- think of it like magic if you like.
32 ################################################################################
38 from daklib.dbconn import *
40 ################################################################################
43 # The ORDER BY is in the queries so that compression of the output works
44 # better. It's the difference between a 9 megabyte bzip2 and a 2.5 mb
51 './pool/' || files.filename AS path
53 JOIN dsc_files ON source.id=dsc_files.source
54 JOIN files ON files.id=dsc_files.file
55 ORDER BY source, version
62 architecture.arch_string AS arch,
63 './pool/' || files.filename AS path,
65 binaries.version AS bin_version
67 JOIN binaries ON source.id=binaries.source
68 JOIN files ON binaries.file=files.id
69 JOIN architecture ON architecture.id=binaries.architecture
70 ORDER BY source, version, package, bin_version
73 session = DBConn().session()
75 for row in session.execute(query_sources).fetchall():
76 (source, version, path) = row
78 print "Source: %s"%source
79 print "Source-Version: %s"%version
82 for row in session.execute(query_binaries).fetchall():
83 (source, version, arch, path, bin, binv) = row
85 print "Source: %s"%source
86 print "Source-Version: %s"%version
87 print "Architecture: %s"%arch
88 print "Binary: %s"%bin
89 print "Binary-Version: %s"%binv
92 ################################################################################
98 #########################################################################################
100 if __name__ == '__main__':
106 # vim:set shiftwidth=4: