From 03cfc1f8a12a8290ffffd1742b608cc566c41003 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Tue, 21 Jun 2016 09:55:40 +0000 Subject: reproducible: breakages: also detect stale files of belonging to old package versions Signed-off-by: Holger Levsen --- bin/reproducible_html_breakages.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_html_breakages.py b/bin/reproducible_html_breakages.py index 4119cf6d..861375b7 100755 --- a/bin/reproducible_html_breakages.py +++ b/bin/reproducible_html_breakages.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- # -# Copyright © 2015 Mattia Rizzolo +# Copyright © 2015-2016 Mattia Rizzolo # Licensed under GPL-2 # # Depends: python3 @@ -128,7 +128,7 @@ def alien_log(directory=None): bad_files.extend(alien_log(path)) return bad_files log.info('running alien_log check over ' + directory + '...') - query = '''SELECT s.name + 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}" @@ -153,7 +153,11 @@ def alien_log(directory=None): ' does not seem to be a file that should be there' + bcolors.ENDC) continue - if not query_db(query.format(pkg=pkg, suite=suite, arch=arch)): + try: + rversion = query_db(query.format(pkg=pkg, suite=suite, arch=arch))[0][0] + except IndexError: # that package is not known (or not yet tested) + rversion = '' # continue towards the "bad file" path + if strip_epoch(rversion) != version: try: if os.path.getmtime('/'.join([root, file]))