summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2023-02-15 18:20:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-19 07:47:53 +0000
commit149ea9db9645e29e29914ff7fab6c67237f7debc (patch)
tree85395535f5c427b1a5bc5f4903dd353399e08f0f /meta/classes-global
parentadd828fa4feafba18930b53ff2deca62d7a02ffd (diff)
downloadpoky-149ea9db9645e29e29914ff7fab6c67237f7debc.tar.gz
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 <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r--meta/classes-global/insane.bbclass19
1 files changed, 3 insertions, 16 deletions
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() {
1357 if not allpatches: 1357 if not allpatches:
1358 continue 1358 continue
1359 1359
1360 kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | re.MULTILINE) 1360 msg = oe.qa.check_upstream_status(fullpath)
1361 strict_status_re = re.compile(r"^Upstream-Status: (Pending|Submitted|Denied|Accepted|Inappropriate|Backport|Inactive-Upstream)( .+)?$", re.MULTILINE) 1361 if msg:
1362 guidelines = "https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status" 1362 oe.qa.handle_error(patchtype, msg, d)
1363
1364 with open(fullpath, encoding='utf-8', errors='ignore') as f:
1365 file_content = f.read()
1366 match_kinda = kinda_status_re.search(file_content)
1367 match_strict = strict_status_re.search(file_content)
1368
1369 if not match_strict:
1370 if match_kinda:
1371 msg = "Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0))
1372 oe.qa.handle_error(patchtype, msg, d)
1373 else:
1374 msg = "Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines)
1375 oe.qa.handle_error(patchtype, msg, d)
1376 1363
1377 oe.qa.exit_if_errors(d) 1364 oe.qa.exit_if_errors(d)
1378} 1365}