summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_html_breakages.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_html_breakages.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_html_breakages.py')
-rwxr-xr-xbin/reproducible_html_breakages.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/bin/reproducible_html_breakages.py b/bin/reproducible_html_breakages.py
index 8c3b37d9..36115fc2 100755
--- a/bin/reproducible_html_breakages.py
+++ b/bin/reproducible_html_breakages.py
@@ -19,7 +19,7 @@ def unrep_with_dbd_issues():
sources_without_dbd = []
query = '''SELECT s.name, r.version, s.suite, s.architecture
FROM sources AS s JOIN results AS r ON r.package_id=s.id
- WHERE r.status="unreproducible"
+ WHERE r.status='unreproducible'
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
results = query_db(query)
for pkg, version, suite, arch in results:
@@ -50,7 +50,7 @@ def not_unrep_with_dbd_file():
bad_pkgs = []
query = '''SELECT s.name, r.version, s.suite, s.architecture
FROM sources AS s JOIN results AS r ON r.package_id=s.id
- WHERE r.status != "unreproducible"
+ WHERE r.status != 'unreproducible'
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
results = query_db(query)
for pkg, version, suite, arch in results:
@@ -69,7 +69,7 @@ def lack_rbuild():
bad_pkgs = []
query = '''SELECT s.name, r.version, s.suite, s.architecture
FROM sources AS s JOIN results AS r ON r.package_id=s.id
- WHERE r.status NOT IN ("blacklisted", "")
+ WHERE r.status NOT IN ('blacklisted', '')
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
results = query_db(query)
for pkg, version, suite, arch in results:
@@ -86,7 +86,7 @@ def lack_buildinfo():
query = '''SELECT s.name, r.version, s.suite, s.architecture
FROM sources AS s JOIN results AS r ON r.package_id=s.id
WHERE r.status NOT IN
- ("blacklisted", "not for us", "FTBFS", "depwait", "404", "")
+ ('blacklisted', 'not for us', 'FTBFS', 'depwait', '404', '')
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
results = query_db(query)
for pkg, version, suite, arch in results:
@@ -108,7 +108,7 @@ def pbuilder_dep_fail():
# and specific versions also come and go
query = '''SELECT s.name, r.version, s.suite, s.architecture
FROM sources AS s JOIN results AS r ON r.package_id=s.id
- WHERE r.status = "FTBFS" AND s.suite = "testing"
+ WHERE r.status = 'FTBFS' AND s.suite = 'testing'
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
results = query_db(query)
for pkg, version, suite, arch in results:
@@ -135,8 +135,8 @@ def alien_log(directory=None):
log.info('running alien_log check over ' + directory + '...')
query = '''SELECT r.version
FROM sources AS s JOIN results AS r ON r.package_id=s.id
- WHERE r.status != "" AND s.name="{pkg}" AND s.suite="{suite}"
- AND s.architecture="{arch}"
+ WHERE r.status != '' AND s.name='{pkg}' AND s.suite='{suite}'
+ AND s.architecture='{arch}'
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
bad_files = []
for root, dirs, files in os.walk(directory):
@@ -179,9 +179,9 @@ def alien_buildinfo():
log.info('running alien_log check...')
query = '''SELECT r.version
FROM sources AS s JOIN results AS r ON r.package_id=s.id
- WHERE r.status != "" AND s.name="{pkg}" AND s.suite="{suite}"
- AND s.architecture="{arch}"
- AND r.status IN ("reproducible", "unreproducible")
+ WHERE r.status != '' AND s.name='{pkg}' AND s.suite='{suite}'
+ AND s.architecture='{arch}'
+ AND r.status IN ('reproducible', 'unreproducible')
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
bad_files = []
for root, dirs, files in os.walk(BUILDINFO_PATH):
@@ -218,8 +218,8 @@ def alien_rbpkg():
log.info('running alien_rbpkg check...')
query = '''SELECT s.name
FROM sources AS s
- WHERE s.name="{pkg}" AND s.suite="{suite}"
- AND s.architecture="{arch}"
+ WHERE s.name='{pkg}' AND s.suite='{suite}'
+ AND s.architecture='{arch}'
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
bad_files = []
for root, dirs, files in os.walk(RB_PKG_PATH):