From 6efa37655cdc61127d423ddfc8449b27e7b02974 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 21 Sep 2015 21:58:02 +0200 Subject: [PATCH] patchutils.py: Add support for parsing Signed-off-by headers. --- debian/tools/patchutils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/tools/patchutils.py b/debian/tools/patchutils.py index fe74a8ab..e1ee00ca 100644 --- a/debian/tools/patchutils.py +++ b/debian/tools/patchutils.py @@ -54,6 +54,7 @@ class PatchObject(object): self.patch_email = header['email'] self.patch_subject = header['subject'] self.patch_revision = header['revision'] if header.has_key('revision') else 1 + self.signed_off_by = header['signedoffby'] if header.has_key('signedoffby') else [] self.filename = filename self.offset_begin = None @@ -329,6 +330,12 @@ def read_patch(filename): if not subject.endswith("."): subject += "." header['subject'], header['revision'] = subject, revision + elif line.startswith("Signed-off-by: "): + if not header.has_key('signedoffby'): + header['signedoffby'] = [] + header['signedoffby'].append(_parse_author(line[15:])) + assert fp.read() == line + elif line.startswith("diff --git "): tmp = line.strip().split(" ") if len(tmp) != 4: raise PatchParserError("Unable to parse git diff header line '%s'." % line)