- q = projectB.query("SELECT b.id FROM binaries b, architecture a WHERE b.package = '%s' AND b.version = '%s' AND (a.arch_string = '%s' OR a.arch_string = 'all') AND b.architecture = a.id" % (package, version, architecture))
-
- ql = q.getresult()
- if not ql:
- daklib.utils.warn("Couldn't find '%s_%s_%s'." % (package, version, architecture))
+ q = session.execute("""SELECT b.id FROM binaries b, architecture a
+ WHERE b.package = :package AND b.version = :version
+ AND (a.arch_string = :arch OR a.arch_string = 'all')
+ AND b.architecture = a.id""",
+ {'package': package, 'version': version, 'arch': architecture})
+
+ ql = q.fetchall()
+ if len(ql) < 1:
+ utils.warn("Couldn't find '%s_%s_%s'." % (package, version, architecture))