summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-02-27 00:08:38 +0100
committerHolger Levsen <holger@layer-acht.org>2015-03-01 14:37:29 +0100
commitf10e23691f8b9848f0e938ad97fc2addb093ca61 (patch)
treebb44607e2744aeb4e5298a3c9b8093a71d449392
parent3061ba70b969b9504107ca2d073e9ccf7edf3fe6 (diff)
downloadjenkins.debian.net-f10e23691f8b9848f0e938ad97fc2addb093ca61.tar.xz
reproducible: common: update pkg_has_buildinfo to the new db schema + support multi-suite/architecture (defaulting to sid/amd64)
-rwxr-xr-xbin/reproducible_common.py7
1 files 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'