diff options
author | Mattia Rizzolo <mattia@debian.org> | 2016-06-21 09:55:40 +0000 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-06-21 15:04:37 +0200 |
commit | 03cfc1f8a12a8290ffffd1742b608cc566c41003 (patch) | |
tree | b9a2d0cefc14e751eb83f1419c986e604d9e50b3 /bin | |
parent | ad1862b26b6531568d45d9364ad343ffec74f845 (diff) | |
download | jenkins.debian.net-03cfc1f8a12a8290ffffd1742b608cc566c41003.tar.xz |
reproducible: breakages: also detect stale files of belonging to old package versions
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_html_breakages.py | 18 |
1 files changed, 13 insertions, 5 deletions
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 <mattia@mapreri.org> +# Copyright © 2015-2016 Mattia Rizzolo <mattia@mapreri.org> # 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]))<time.time()-1800: bad_files.append('/'.join([root, file])) @@ -167,7 +171,7 @@ def alien_log(directory=None): def alien_buildinfo(): log.info('running alien_log check...') - 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}" @@ -186,7 +190,11 @@ def alien_buildinfo(): ' 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: bad_files.append('/'.join([root, file])) log.warning('/'.join([root, file]) + ' should not be there') return bad_files |