From: Martin Jansa <[email protected]>

* the idea was to reuse the same function as I've noticed that the
  QA check which was added to insane.bbclass in:
  
https://git.openembedded.org/openembedded-core/commit/?id=76a685bfcf927593eac67157762a53259089ea8a
  is in some cases more strcit than scripts/contrib/patchreview.py

  To be honest I wasn't aware of scripts/contrib/patchreview.py
  existence when I've asked about moving check_upstream_status()
  to oe.qa in order to write standalone script just like
  patchreview.py

* I've sent this long time ago:
  https://lists.openembedded.org/g/openembedded-core/message/177207
  but didn't like the sys.path.append to find oe.qa much or the
  duplicated path to .patch file in the output, then I've forgot about
  it until today in https://github.com/OE4T/meta-tegra/pull/1749
  where checklayer found one more issue, which I haven't noticed
  with patchreview.py before (because I've accidentally used a version
  without this change). It's not perfect, but at least it will be
  consistent with checklayer and patch-status QA check.

Signed-off-by: Martin Jansa <[email protected]>
---
v2: just rebased to resolve conflicts from import cleanup

 scripts/contrib/patchreview.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/contrib/patchreview.py b/scripts/contrib/patchreview.py
index bceae06561..69ef14eb44 100755
--- a/scripts/contrib/patchreview.py
+++ b/scripts/contrib/patchreview.py
@@ -14,6 +14,10 @@ import pathlib
 import re
 import subprocess
 
+import sys
+sys.path.append(os.path.join(sys.path[0], '../../meta/lib'))
+import oe.qa
+
 # TODO
 # - option to just list all broken files
 # - test suite
@@ -78,12 +82,11 @@ def patchreview(patches):
         else:
             result.missing_sob = True
 
-
         # Find the Upstream-Status tag
         match = status_re.search(content)
         if match:
-            value = match.group(1)
-            if value != "Upstream-Status:":
+            value = oe.qa.check_upstream_status(patch)
+            if value:
                 result.malformed_upstream_status = value
 
             value = match.group(2).lower()
-- 
2.47.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206786): 
https://lists.openembedded.org/g/openembedded-core/message/206786
Mute This Topic: https://lists.openembedded.org/mt/109425947/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to