From 149ea9db9645e29e29914ff7fab6c67237f7debc Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Wed, 15 Feb 2023 18:20:40 +0100 Subject: insane.bbclass: move Upstream-Status logic to oe.qa * to be used by standalone script scripts/contrib/patchreview.py as well (From OE-Core rev: c326efeec8f576200728a44c694becdeab4fe2db) Signed-off-by: Martin Jansa Signed-off-by: Richard Purdie --- meta/classes-global/insane.bbclass | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'meta/classes-global') diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 4053eda094..ee34d5208d 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -1357,22 +1357,9 @@ python do_qa_patch() { if not allpatches: continue - kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | re.MULTILINE) - strict_status_re = re.compile(r"^Upstream-Status: (Pending|Submitted|Denied|Accepted|Inappropriate|Backport|Inactive-Upstream)( .+)?$", re.MULTILINE) - guidelines = "https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status" - - with open(fullpath, encoding='utf-8', errors='ignore') as f: - file_content = f.read() - match_kinda = kinda_status_re.search(file_content) - match_strict = strict_status_re.search(file_content) - - if not match_strict: - if match_kinda: - msg = "Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0)) - oe.qa.handle_error(patchtype, msg, d) - else: - msg = "Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines) - oe.qa.handle_error(patchtype, msg, d) + msg = oe.qa.check_upstream_status(fullpath) + if msg: + oe.qa.handle_error(patchtype, msg, d) oe.qa.exit_if_errors(d) } -- cgit v1.2.3-54-g00ecf