From 1d7968088e6bda919b52874496691c931daab694 Mon Sep 17 00:00:00 2001 From: Sean Finney Date: Fri, 5 Mar 2010 07:55:03 +0100 Subject: Allow blank lines and comments in quilt series files Thanks to Colin Watson for the suggestion. --- patchtracker/Patch.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'patchtracker') diff --git a/patchtracker/Patch.py b/patchtracker/Patch.py index d6044cc..6533910 100644 --- a/patchtracker/Patch.py +++ b/patchtracker/Patch.py @@ -148,9 +148,18 @@ class Quilt30PatchSeries (GenericPatchSeries): except KeyError: series_fh = self.tarfh.extractfile("debian/patches/series") except KeyError: - self.names = [] - else: - self.names = [fn.strip() for fn in series_fh.readlines()] + series_fh = None + + if series_fh: + for line in filter(None, [fn.strip() for fn in series_fh.readlines()]): + stuff = line.split(' ') + # skip comments + if stuff[0][0] == "#": + continue + # here's the name + name = stuff[0] + self.names.append(name) + # XXX to lazy eval this might be better for name in self.names: self.patches[name] = Patch(self.tarfh.extractfile("debian/patches/"+name)) -- cgit v1.2.3