[Qa-jenkins-scm] [jenkins.debian.net] 03/03: reproducible: breakages: also detect stale files of belonging to old package versions

Holger Levsen holger at layer-acht.org
Tue Jun 21 13:05:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 03cfc1f8a12a8290ffffd1742b608cc566c41003
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Tue Jun 21 09:55:40 2016 +0000

    reproducible: breakages: also detect stale files of belonging to old package versions
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_html_breakages.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/bin/reproducible_html_breakages.py b/bin/reproducible_html_breakages.py
index 4119cf6..861375b 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 at mapreri.org>
+# Copyright © 2015-2016 Mattia Rizzolo <mattia at 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list