[yocto] [patchwork][PATCH] patchwork/bin/parsemail: Make "[PATCH" prefix mandatory

Jose Lamego jose.a.lamego at linux.intel.com
Fri Jan 6 15:03:05 PST 2017


Patchwork may incorrectly identify emails containing patch-like content as
patches.
This change makes "[PATCH" prefix in subject mandatory for emails to be
considered as new patches.

[YOCTO #10764]

Signed-off-by: Jose Lamego <jose.a.lamego at linux.intel.com>
---
 patchwork/bin/parsemail.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py
index 476118d..8d6529c 100755
--- a/patchwork/bin/parsemail.py
+++ b/patchwork/bin/parsemail.py
@@ -399,7 +399,8 @@ def find_content(project, mail):
     refs = build_references_list(mail)
     is_root = refs == []
     is_cover_letter = is_root and x == 0
-    is_patch = patchbuf is not None
+    patch_prefix = re.search('\[\s*PATCH', mail.get('Subject'))
+    is_patch = patchbuf is not None and patch_prefix
 
     drop_patch = not is_attachment and \
         project.git_send_email_only and not is_git_send_email(mail)
-- 
1.9.1




More information about the yocto mailing list