summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_json.py
diff options
context:
space:
mode:
authorValerie R Young <spectranaut@riseup.net>2016-09-09 15:12:15 -0400
committerHolger Levsen <holger@layer-acht.org>2016-10-17 11:22:18 +0200
commit078490603dea0a356c79fd448c5d5a861b218992 (patch)
treed2388a3c205a45f0de9cbaf57bb1d5ce4ce923f2 /bin/reproducible_json.py
parenta363474122e9a7b59c099bca13e0f5c5845a87c4 (diff)
downloadjenkins.debian.net-078490603dea0a356c79fd448c5d5a861b218992.tar.xz
reproducible debian: make python sql more sqlite/postgres agnostic
This commit fixes all the python script sql queries that required minimal editing to be syntactically correct for both sqlite and postgres. Almost all fixes consist of the removal of double quotes from query strings. NOTE: the following scripts expect the schedule table's primary key to autoincrement. Running reproducible_db_maintence.py on a postgres database will not add the necessary autoincrementing functionality at this time. The following script WILL run on the sqlite database but will fail on postgres database constructed from reproducible_db_maintence.py until this is fixed: reproducible_remote_scheduler.py reproducible_schedule.py Signed-off-by: Mattia Rizzolo <mattia@debian.org> Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_json.py')
-rwxr-xr-xbin/reproducible_json.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/reproducible_json.py b/bin/reproducible_json.py
index 6d20a6b3..33e0fb3e 100755
--- a/bin/reproducible_json.py
+++ b/bin/reproducible_json.py
@@ -25,10 +25,10 @@ output4tracker = []
log.info('Creating json dump of current reproducible status')
# filter_query is defined in reproducible_common.py and excludes some FTBFS issues
-query = 'SELECT s.name, r.version, s.suite, s.architecture, r.status, r.build_date ' + \
- 'FROM results AS r JOIN sources AS s ON r.package_id = s.id '+ \
- 'WHERE status != "" AND status NOT IN ("not for us", "404", "blacklisted" ) AND (( status != "FTBFS" ) OR ' \
- ' ( status = "FTBFS" and r.package_id NOT IN (SELECT n.package_id FROM NOTES AS n WHERE ' + filter_query + ' )))'
+query = "SELECT s.name, r.version, s.suite, s.architecture, r.status, r.build_date " + \
+ "FROM results AS r JOIN sources AS s ON r.package_id = s.id "+ \
+ "WHERE status != '' AND status NOT IN ('not for us', '404', 'blacklisted' ) AND (( status != 'FTBFS' ) OR " \
+ " ( status = 'FTBFS' and r.package_id NOT IN (SELECT n.package_id FROM NOTES AS n WHERE " + filter_query + " )))"
result = sorted(query_db(query))
log.info('\tprocessing ' + str(len(result)))