commit 613933a3771d9115f0394206902970f7a481512e parent e0adbf7a5980d43f38b3416e5488e4fc58fa612d Author: parazyd <parazyd@dyne.org> Date: Thu, 13 Jul 2017 17:11:57 +0200 better header garbage skip in merge_contents Diffstat:
M | amprolla_merge_contents.py | | | 10 | +++++++--- |
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/amprolla_merge_contents.py b/amprolla_merge_contents.py @@ -26,11 +26,15 @@ def merge_contents(filelist): cfile = cfile.decode('utf-8') contents = cfile.split('\n') + header = False for line in contents: if line.startswith('This file maps each file'): - while not line.startswith('FILE'): - continue - if line != '' and not line.startswith('FILE'): + header = True + if line.startswith('FILE'): + header = False + continue + + if line != '' and not header: sin = line.split() if sin[-1] not in pkgs.keys(): pkgs[sin[-1]] = []