From 0fa3b3812ca01e748ec2d0e43af6c092deb2bd3d Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Tue, 3 Mar 2020 17:27:52 +0000 Subject: [PATCH] reduce more spec file noise --- patchfilter.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/patchfilter.py b/patchfilter.py index 0ed1951..eb761c3 100644 --- a/patchfilter.py +++ b/patchfilter.py @@ -102,6 +102,22 @@ def zap_entire_file_end(filename): if file.endswith(filename): files.remove(file) +def zap_line_in_file_substring(filename, match): + global header + global files + global files_chunks + global files_header + for file in files: + if file.endswith(filename): + for chunk in files_chunks[file]: + to_delete = list() + for line in chunk: + if match in line: + to_delete.append(line) + for line in to_delete: + chunk.remove(line) + + def zap_line_in_file(filename, match): global header global files @@ -364,7 +380,9 @@ def main(): zap_entire_file("b/whatrequires") zap_entire_file("b/versions") zap_entire_file("b/.gitignore") + + zap_line_in_file_substring(".spec", "%{buildroot}/usr/share/package-licenses") # version number change in license copy zap_empty_chunks() print_all()