From patchwork Wed Feb 15 17:20:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 19592 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9985EC64ED6 for ; Wed, 15 Feb 2023 17:20:59 +0000 (UTC) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.groups.io with SMTP id smtpd.web11.21414.1676481652986870713 for ; Wed, 15 Feb 2023 09:20:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HedbRcz8; spf=pass (domain: gmail.com, ip: 209.85.221.49, mailfrom: martin.jansa@gmail.com) Received: by mail-wr1-f49.google.com with SMTP id m10so10990884wrn.4 for ; Wed, 15 Feb 2023 09:20:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZxCi0gZaI81z7guYh8Sd4Ei1YWYuoOt22OyVc6NDpLk=; b=HedbRcz86pvtiwesy/KvsrQO3f3pkDcSovGkOuJqE5GbR2j2fq0ain6+ZfqceYzX0z 4ohEk9hrbchAOmKFigHnl0rDM0bu5zmEzz5DvXjIQCMOmY3jvvvx6Mp7RyGb2hbBkKFk kwkvSIWVgz4dkdgKSiWa7wMRCfKCvFHgTYYKmwkIMVhzNptG47N04GINKoFO7RdD3S4Y wSa3rxutJnPgp8CA0+BQs0I5+DRiHVSRS2/sCEwNzgEP5OaJbHafm/gG/vSZb2HLsNqm PGY5JGKlMq1WRlvkkI0ZyuPGCrCwPD1WUSqls0LzXYDSu1ugF3gDRvQfr1dACqnhPxIn MRng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZxCi0gZaI81z7guYh8Sd4Ei1YWYuoOt22OyVc6NDpLk=; b=muEuq0MWEaUqoTq8tONS/n6N8S2PRm+h+8QylJ/U7/Bo9Q4zIK9tAQeY/6xa0fBFgU li2dFI1C4wlGpr+rf/5sXl51tUe2kHN0GMH4di0ArFlXIRO2KZflliY2rMGwcdyljvTs Mm1X53q1Olwit4eVVUHuZJ85ykMQ3VHpqZc8hk/cafJV7OpNK2SC4J74QeJV8fpitkET tslhUqdfxBAU3xrALEvioFigPbzZv+wL5vDKc/vjglL27pR0cCj7OSCkEQGXL1GGpobt sYD2N41jv8/UrXuhoJSRQlj1U+Rtl+lAp580Cf7fkUPuNMzsPL7WHTOQqJ5FbgyYclv7 KOGw== X-Gm-Message-State: AO0yUKVPq34/gz98xtEo+T63IgAnc/zVWZzV30H0T1r5pFwDKhMqapIL /x9I/bgf57Av/xkUnxp8NZrGBG5Spqw= X-Google-Smtp-Source: AK7set+5i27ZYp1NepMkOw+AVIUNGJd0xx3hlPH5RIZxZKxNWSxoxfWVZC83zGzZVvhJAVqGdo4Mng== X-Received: by 2002:adf:ce91:0:b0:2bf:ec8b:3a5 with SMTP id r17-20020adfce91000000b002bfec8b03a5mr2171768wrn.46.1676481651414; Wed, 15 Feb 2023 09:20:51 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id hg6-20020a05600c538600b003b47b80cec3sm2589251wmb.42.2023.02.15.09.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 09:20:51 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Cc: ross.burton@arm.com, Martin Jansa Subject: [PATCH 1/3] insane.bbclass: use 4 spaces for indentation Date: Wed, 15 Feb 2023 18:20:39 +0100 Message-Id: <20230215172041.636292-1-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 15 Feb 2023 17:20:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/177205 * this block was using just 3 Signed-off-by: Martin Jansa --- meta/classes-global/insane.bbclass | 50 +++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index e1295f8539..720b75c395 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -1349,31 +1349,31 @@ python do_qa_patch() { coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '') for url in patch.src_patches(d): - (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url) - - # skip patches not in oe-core - patchtype = "patch-status-core" - if not os.path.abspath(fullpath).startswith(coremeta_path): - patchtype = "patch-status-noncore" - 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) + (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url) + + # skip patches not in oe-core + patchtype = "patch-status-core" + if not os.path.abspath(fullpath).startswith(coremeta_path): + patchtype = "patch-status-noncore" + 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) oe.qa.exit_if_errors(d) } From patchwork Wed Feb 15 17:20:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 19591 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97963C636D7 for ; Wed, 15 Feb 2023 17:20:59 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web10.21358.1676481655283413036 for ; Wed, 15 Feb 2023 09:20:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ayN2/Stz; spf=pass (domain: gmail.com, ip: 209.85.221.51, mailfrom: martin.jansa@gmail.com) Received: by mail-wr1-f51.google.com with SMTP id o15so16598825wrc.9 for ; Wed, 15 Feb 2023 09:20:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P1GZk4ZoALb3Dz6/DciIX4hzJhNGJ4VeVucIwwJFV18=; b=ayN2/StzpZHRGFU6eMQ7osE1+U+mCc/7jk+Qaf2kdzeUoZCJ4wvOAKG2vsn2UqDHLW EA7Xqr4LZU4dpbC9YGDVZQzz5r8j566ZhBybTPLxxjXRbCzZXMRrC6G7Duqag3E8XVN8 o4s6bj/TYkpwtvQ85XE/ycMC76LPZKk5m87bGfW1YfbjCD3W4Td/vlpwawBnuPoBBWgR rCMUVlS2aNaNLYLcrmT/vGneTOFQD9Q4iIdodR0t1ZVNNl/UtgTtpaIaAKlv6N7o3xGh 0xrAqMNQzuAdzKkTplYT1t6Vd7uEMc4ecWghG3k/RZfhsV9V7eOpu0WPMKQAwnrpGmOh 5pVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P1GZk4ZoALb3Dz6/DciIX4hzJhNGJ4VeVucIwwJFV18=; b=oDqvPgwDRY0nyPnAST/Io7S4Gdn9Taq8JD3JXYztP8+zBihVqBz3kS7T4hzgk3M74c B+t6VJ9gZOsvsd7/iaKCIqVc6EWzxJgbw1Agny1vHI5bGlRAzMO0SS3HaEBNKYEUqvUs yz3EXoILx5Qv8l9TpeQ6fRNL+MjbWZWaFdwf6lYb/u2SY3mFMYJUh56/7XHAWmi86y7v HTsivzoIWPP8lXTDd2WqVJNPPvM4RgfuiigHNoOKS13gnls41UI/qvX64dv+aEw6K/l4 vbw/J323NR7ol6IsZgtwyOrHh4QkjUFgtlMw7dwYFe+rjVtlE/qhq3n6+hV0jDWjjvtA 3p4w== X-Gm-Message-State: AO0yUKX6AbkvXE4E+uU9bxdFI2aMQH+b+QaMySEUh9zXFxVEOhNKhJQa pgM45vUqoUY87H5Ei9ARNVNxI75jUeo= X-Google-Smtp-Source: AK7set/ErVvZFuQTqs8XxKnLzmhVpjyf10kMex/hQh2EM/yrvaXbq88OTGAnyMfxmakcajlIP6CQdw== X-Received: by 2002:adf:e4cc:0:b0:2c5:3ccf:e99a with SMTP id v12-20020adfe4cc000000b002c53ccfe99amr2131673wrm.6.1676481653733; Wed, 15 Feb 2023 09:20:53 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id z13-20020adfe54d000000b002c567e3808bsm4194774wrm.40.2023.02.15.09.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 09:20:53 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Cc: ross.burton@arm.com, Martin Jansa Subject: [RFC][PATCH 2/3] insane.bbclass: move Upstream-Status logic to oe.qa Date: Wed, 15 Feb 2023 18:20:40 +0100 Message-Id: <20230215172041.636292-2-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230215172041.636292-1-Martin.Jansa@gmail.com> References: <20230215172041.636292-1-Martin.Jansa@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 15 Feb 2023 17:20:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/177206 * to be used by standalone script scripts/contrib/patchreview.py as well Signed-off-by: Martin Jansa --- meta/classes-global/insane.bbclass | 19 +++---------------- meta/lib/oe/qa.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 720b75c395..c8e4219389 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -1358,22 +1358,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) } diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py index b4cbc50045..de980638c4 100644 --- a/meta/lib/oe/qa.py +++ b/meta/lib/oe/qa.py @@ -213,6 +213,23 @@ def exit_with_message_if_errors(message, d): def exit_if_errors(d): exit_with_message_if_errors("Fatal QA errors were found, failing task.", d) +def check_upstream_status(fullpath): + import re + 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: + return "Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0)) + else: + return "Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines) + if __name__ == "__main__": import sys From patchwork Wed Feb 15 17:20:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 19593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AA5FC64EC4 for ; Wed, 15 Feb 2023 17:20:59 +0000 (UTC) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.web11.21418.1676481657991055149 for ; Wed, 15 Feb 2023 09:20:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aPNEk06P; spf=pass (domain: gmail.com, ip: 209.85.128.44, mailfrom: martin.jansa@gmail.com) Received: by mail-wm1-f44.google.com with SMTP id l21-20020a05600c1d1500b003dfe462b7e4so2922843wms.0 for ; Wed, 15 Feb 2023 09:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8nl2B8Bhoc8UI1Vi6VdGrVJJOJuAkopIaOw/POBXscc=; b=aPNEk06PpqSUVkaCHugkroGIOk/OyXAySkuIyg992TisWNTs5DUcTfn9WoGhqfFbey WzG0/VMIxSWK0gBntUm/SBPSQjiN/ExkUXv0eEDiMB+BBDtGodYuxTJjVXMlLbdPoaw+ gi9rinIz39TzdVOdRoJzgohdoa/WMHTeWf/eYyU8nmbRyKWwfao0NT9fL6WWxSTUbYS7 Wsad4Ko3D/uNgKAjWKhwMnlD3x8/iMdRU3bq0z6BNCWVVmWsCg+gm+xVKKa9dwpyuZwX byFql0PRvphhtLsMPQp8szD3KTtY9izOKHOUUwceMCaWbz+gTwyziKyrHW/Q0ugxaaHE wx1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8nl2B8Bhoc8UI1Vi6VdGrVJJOJuAkopIaOw/POBXscc=; b=G+KJaG+eL7b09Yhggs39kfGHo4wGxY9E5RYFd8eYmUV1pJNws5yAyZDIZteAPRrsJJ ohtS7t9nHNt9kuC6er0Ml4+NOmKmznZnhuzR7CS3XFMKroikjKVXa2VquPNxpUG1M0uF UPyVQQMYB0yWa8RVOog5+fnpLMJ5mQwkCLbKuTkIn0gCXBkTAbfNtOR68V33NavP209y oElxFSWZaOkG3YqvAEb+j+G2/O+/gaefpzo/O938tZcMxXbil+68rRxbLkUA/IDeryag 0+E0hzYPJRmI0fwQNSlkxKeJALTLTA69kaL9zpvTNajJHKq9AMBu1GLKNDJxXTo/No+7 Hjpg== X-Gm-Message-State: AO0yUKVrxtvOZBwPKj/5D3zhM0h4epIeA+tmu6Nu+GWZsoJNy3kurD+t PFfmkmQ2hd2kR+T28LiyIEd+IcFUxN8= X-Google-Smtp-Source: AK7set958jA56v3JZbViZJPCP/K10XqvrP56l/dJtqbv8/yDxXPM5V6h5VrHGVbxGqSWnVBsRxvRWA== X-Received: by 2002:a05:600c:474b:b0:3d2:2d2a:d581 with SMTP id w11-20020a05600c474b00b003d22d2ad581mr2590823wmo.30.1676481656476; Wed, 15 Feb 2023 09:20:56 -0800 (PST) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id l16-20020a05600c1d1000b003dc3f07c876sm3198857wms.46.2023.02.15.09.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 09:20:56 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Cc: ross.burton@arm.com, Martin Jansa Subject: [RFC][PATCH 3/3] patchreview: use check_upstream_status() from oe.qa Date: Wed, 15 Feb 2023 18:20:41 +0100 Message-Id: <20230215172041.636292-3-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230215172041.636292-1-Martin.Jansa@gmail.com> References: <20230215172041.636292-1-Martin.Jansa@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 15 Feb 2023 17:20:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/177207 * 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, now I don't feel strongly about sharing this functionality (other than adjusting regexes in patchreview.py) * it finds one "new" issue in oe-core: Malformed Upstream-Status 'Malformed Upstream-Status in patch meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch Please correct according to https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status : Upstream-Status: Inappropriate[oe specific]' (meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch) * but unlike the QA check patchreview.py will report this: -Upstream-Status: Submitted [https://github.com/madler/zlib/pull/599] +Upstream-Broken-Status: Submitted [https://github.com/madler/zlib/pull/599] as a missing Upstream-Status instead of malformed as reported by QA check: ERROR: zlib-native-1.2.13-r0 do_patch: QA Issue: Malformed Upstream-Status in patch /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch Please correct according to https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status : Upstream-Broken-Status: Submitted [https://github.com/madler/zlib/pull/599] [patch-status-core] * RFC: let me know if you think it's worth re-working this to better integrate (e.g. detecting Upstream-Broken-Status and not repeating .patch path in patchreview.py output) or if I should just adjust regexes in patchreview.py. Signed-off-by: Martin Jansa --- scripts/contrib/patchreview.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/contrib/patchreview.py b/scripts/contrib/patchreview.py index b22cc07f0a..ce6b0f05c4 100755 --- a/scripts/contrib/patchreview.py +++ b/scripts/contrib/patchreview.py @@ -42,7 +42,9 @@ def blame_patch(patch): "--", patch)).decode("utf-8").splitlines() def patchreview(path, patches): - import re, os.path + import re, os.path, sys + sys.path.append(os.path.join(sys.path[0], '../../meta/lib')) + import oe.qa # General pattern: start of line, optional whitespace, tag with optional # hyphen or spaces, maybe a colon, some whitespace, then the value, all case @@ -72,12 +74,11 @@ def patchreview(path, 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(fullpath) + if value: result.malformed_upstream_status = value value = match.group(2).lower()