[Qa-jenkins-scm] [jenkins.debian.net] 02/03: reproducible: breakages: in alien_log(), correctly deal with different file names with different splitting needs

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 ad1862b26b6531568d45d9364ad343ffec74f845
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Tue Jun 21 09:54:40 2016 +0000

    reproducible: breakages: in alien_log(), correctly deal with different file names with different splitting needs
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_html_breakages.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/reproducible_html_breakages.py b/bin/reproducible_html_breakages.py
index af32e4f..4119cf6 100755
--- a/bin/reproducible_html_breakages.py
+++ b/bin/reproducible_html_breakages.py
@@ -139,8 +139,15 @@ def alien_log(directory=None):
             continue
         suite, arch = root.rsplit('/', 2)[1:]
         for file in files:
+            # different file have differnt name patterns and different splitting needs
+            if file.endswith('.diff.gz'):
+                rsplit_level = 2
+            elif file.endswith('.gz'):
+                rsplit_level = 3
+            else:
+                rsplit_level = 2
             try:
-                pkg, version = file.rsplit('.', 2)[0].rsplit('_', 1)
+                pkg, version = file.rsplit('.', rsplit_level)[0].rsplit('_', 1)
             except ValueError:
                 log.critical(bcolors.FAIL + '/'.join([root, file]) +
                              ' does not seem to be a file that should be there'

-- 
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