From f10e23691f8b9848f0e938ad97fc2addb093ca61 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 27 Feb 2015 00:08:38 +0100 Subject: reproducible: common: update pkg_has_buildinfo to the new db schema + support multi-suite/architecture (defaulting to sid/amd64) --- bin/reproducible_common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 7782f623..dd0321e9 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -351,13 +351,16 @@ def strip_epoch(version): except IndexError: return version -def pkg_has_buildinfo(package, version=False): +def pkg_has_buildinfo(package, version=False, suite='sid', arch='amd64'): """ if there is no version specified it will use the version listed in reproducible.db """ if not version: - query = 'SELECT version FROM source_packages WHERE name="%s"' % package + query = 'SELECT r.version ' + \ + 'FROM results AS r JOIN sources AS s on r.package_id=s.id ' + \ + 'WHERE s.name="{}" AND s.suite="{}" AND s.architecture="{}"' + query = query.format(package, suite, arch) version = str(query_db(query)[0][0]) buildinfo = BUILDINFO_PATH + '/' + package + '_' + \ strip_epoch(version) + '_amd64.buildinfo' -- cgit v1.2.3-70-g09d2