[02/13] insane.bbclass: do not hardcode oe-core path in upstream-status check

Message ID 20211127095357.1748429-2-alex@linutronix.de
State New
Headers show
Series [01/13] insane.bbclass: add a check that Upstream-Status patch tag is present and correctly formed | expand

Commit Message

Alexander Kanavin Nov. 27, 2021, 9:53 a.m. UTC
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes/insane.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Konrad Weihmann Nov. 27, 2021, 11:01 a.m. UTC | #1
On 27.11.21 10:53, Alexander Kanavin wrote:
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>   meta/classes/insane.bbclass | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 240f3aad62..8a47da5a09 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -1176,7 +1176,9 @@ python do_qa_patch() {
>          (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
>   
>          # skip patches not in oe-core
> -       if '/meta/' not in fullpath:

Last time my morning coffee didn't fully work, so let's try it again...
What I would want to see (maybe in a followup patch) is to have the 
layers, where this check is performed, configurable (not just core), as 
I think also other people would want to make use of this very nice check.

Maybe something like

INSANE_PATCH_US_PATTERN ??= "BBFILE_PATTERN_core"

and then

match_oecore = any(re.search(re.compile(x), fullpath)) for x in 
(d.getVar('INSANE_PATCH_US_PATTERN' or '').split(" "))

> +       oecore_re = re.compile(d.getVar('BBFILE_PATTERN_core'))
> +       match_oecore = oecore_re.search(fullpath)
> +       if not match_oecore:
>              continue
>   
>          content = open(fullpath, encoding='utf-8', errors='ignore').read()
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#158851): https://lists.openembedded.org/g/openembedded-core/message/158851
> Mute This Topic: https://lists.openembedded.org/mt/87335190/3647476
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [kweihmann@outlook.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alexander Kanavin Nov. 27, 2021, 2:13 p.m. UTC | #2
I would like to get RPs blessing for the patch as it is first, there were
concerns about state signatures (oe selftest is fine though).

Alex

On Sat 27. Nov 2021 at 12.01, Konrad Weihmann <kweihmann@outlook.com> wrote:

>
>
> On 27.11.21 10:53, Alexander Kanavin wrote:
> > Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > ---
> >   meta/classes/insane.bbclass | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> > index 240f3aad62..8a47da5a09 100644
> > --- a/meta/classes/insane.bbclass
> > +++ b/meta/classes/insane.bbclass
> > @@ -1176,7 +1176,9 @@ python do_qa_patch() {
> >          (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
> >
> >          # skip patches not in oe-core
> > -       if '/meta/' not in fullpath:
>
> Last time my morning coffee didn't fully work, so let's try it again...
> What I would want to see (maybe in a followup patch) is to have the
> layers, where this check is performed, configurable (not just core), as
> I think also other people would want to make use of this very nice check.
>
> Maybe something like
>
> INSANE_PATCH_US_PATTERN ??= "BBFILE_PATTERN_core"
>
> and then
>
> match_oecore = any(re.search(re.compile(x), fullpath)) for x in
> (d.getVar('INSANE_PATCH_US_PATTERN' or '').split(" "))
>
> > +       oecore_re = re.compile(d.getVar('BBFILE_PATTERN_core'))
> > +       match_oecore = oecore_re.search(fullpath)
> > +       if not match_oecore:
> >              continue
> >
> >          content = open(fullpath, encoding='utf-8',
> errors='ignore').read()
> >
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#158851):
> https://lists.openembedded.org/g/openembedded-core/message/158851
> > Mute This Topic: https://lists.openembedded.org/mt/87335190/3647476
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> kweihmann@outlook.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 240f3aad62..8a47da5a09 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -1176,7 +1176,9 @@  python do_qa_patch() {
        (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
        # skip patches not in oe-core
-       if '/meta/' not in fullpath:
+       oecore_re = re.compile(d.getVar('BBFILE_PATTERN_core'))
+       match_oecore = oecore_re.search(fullpath)
+       if not match_oecore:
            continue
 
        content = open(fullpath, encoding='utf-8', errors='ignore').read()