- files f, location l, component c, maintainer m
- WHERE b.package %s '%s' AND a.id = b.architecture AND su.id = ba.suite
- AND b.id = ba.bin AND b.file = f.id AND f.location = l.id
- AND l.component = c.id AND b.maintainer = m.id %s %s %s
-""" % (comparison_operator, package, con_suites, con_architectures, con_bintype))
- ql = q.getresult()
+ files f, files_archive_map af, component c, maintainer m
+ WHERE b.package %s :package AND a.id = b.architecture AND su.id = ba.suite
+ AND b.id = ba.bin AND b.file = f.id AND af.file_id = f.id AND su.archive_id = af.archive_id
+ AND af.component_id = c.id AND b.maintainer = m.id %s %s %s
+""" % (comparison_operator, con_suites, con_architectures, con_bintype), {'package': package})
+ ql = q.fetchall()