]> git.decadent.org.uk Git - dak.git/commitdiff
dak/control_suite.py: prefetch files table when looking up a binary or source package
authorAnsgar Burchardt <ansgar@debian.org>
Sat, 11 Aug 2012 09:38:20 +0000 (11:38 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sat, 11 Aug 2012 11:44:14 +0000 (13:44 +0200)
dak/control_suite.py

index cdce40c5f5c5a141dbbde346c1b7bd53fce07748..fecd76405148e1c22a2beded10d1f1d267c52bbc 100755 (executable)
@@ -75,10 +75,12 @@ Display or alter the contents of a suite using FILE(s), or stdin.
 
 def get_pkg(package, version, architecture, session):
     if architecture == 'source':
-        q = session.query(DBSource).filter_by(source=package, version=version)
+        q = session.query(DBSource).filter_by(source=package, version=version) \
+            .join(DBSource.poolfile)
     else:
         q = session.query(DBBinary).filter_by(package=package, version=version) \
-            .join(DBBinary.architecture).filter(Architecture.arch_string.in_([architecture, 'all']))
+            .join(DBBinary.architecture).filter(Architecture.arch_string.in_([architecture, 'all'])) \
+            .join(DBBinary.poolfile)
 
     pkg = q.first()
     if pkg is None: