public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Subject: Re: [PATCH 2/2] meta/base.bbclass: integrate COMPATIBLE_MACHINE feature
Date: Thu, 17 Aug 2023 17:06:35 +0300	[thread overview]
Message-ID: <2c2aabe3-0a93-8389-8822-1a6c58f17ecf@ilbers.de> (raw)
In-Reply-To: <20230817135725.2524796-3-ch@denx.de>

17/08/2023 16:57, Claudius Heine wrote:
> Integrate the COMPATIBLE_MACHINE of OE, where recipes can specify a
> regex in COMPATIBLE_MACHINE that needs to match to an entry of the
> MACHINEOVERRIDES variable, otherwise the recipe will be skipped.
>
> Similar to OE, with `PARSE_ALL_RECIPES`, parsing of the recipe can be
> enforced.
>
> This code was copied from the OE-core codebase.
>
> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
>   meta/classes/base.bbclass | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 17bebe94..68e88390 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -165,6 +165,16 @@ python() {
>                   d.prependVar(
>                       e, cleandir_code.format(ws=ws, dirlist=" ".join(dirs))
>                   )
> +
> +    need_machine = d.getVar('COMPATIBLE_MACHINE')
> +    if need_machine and not d.getVar('PARSE_ALL_RECIPES', False):
> +        import re
> +        compat_machines = (d.getVar('MACHINEOVERRIDES') or "").split(":")
> +        for m in compat_machines:
> +            if re.match(need_machine, m):
> +                break
> +        else:
> +            raise bb.parse.SkipRecipe("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE'))
>   }
>   
>   def isar_export_proxies(d):

Hello Claudius,
Import re is not needed here because already done at top of the function.


  reply	other threads:[~2023-08-17 14:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17 13:57 [PATCH 0/2] Integrate compatibiliy systems Claudius Heine
2023-08-17 13:57 ` [PATCH 1/2] meta/bitbake.conf: add MACHINEOVERRIDES and DISTROOVERRIDES Claudius Heine
2023-08-17 13:57 ` [PATCH 2/2] meta/base.bbclass: integrate COMPATIBLE_MACHINE feature Claudius Heine
2023-08-17 14:06   ` Anton Mikanovich [this message]
2023-08-17 14:45     ` Claudius Heine
2023-08-17 14:49       ` Anton Mikanovich
2023-08-23  7:53         ` Uladzimir Bely
2023-08-17 14:09 ` [PATCH 0/2] Integrate compatibiliy systems Anton Mikanovich
2023-08-17 14:48 ` Baurzhan Ismagulov
2023-08-17 15:00   ` Claudius Heine
2023-08-17 15:05     ` Baurzhan Ismagulov
2023-08-24 15:15 ` Uladzimir Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c2aabe3-0a93-8389-8822-1a6c58f17ecf@ilbers.de \
    --to=amikan@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox