From ad1862b26b6531568d45d9364ad343ffec74f845 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Tue, 21 Jun 2016 09:54:40 +0000 Subject: reproducible: breakages: in alien_log(), correctly deal with different file names with different splitting needs Signed-off-by: Holger Levsen --- bin/reproducible_html_breakages.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/reproducible_html_breakages.py b/bin/reproducible_html_breakages.py index af32e4fd..4119cf6d 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' -- cgit v1.2.3-70-g09d2