tbetter header garbage skip in merge_contents - amprolla - devuan's apt repo merger HTML git clone git://parazyd.org/amprolla.git DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 613933a3771d9115f0394206902970f7a481512e DIR parent e0adbf7a5980d43f38b3416e5488e4fc58fa612d HTML 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(-) --- DIR diff --git a/amprolla_merge_contents.py b/amprolla_merge_contents.py t@@ -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]] = []