public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Claudius Heine <ch@denx.de>
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [PATCH 2/2] meta/base.bbclass: integrate COMPATIBLE_MACHINE feature
Date: Thu, 17 Aug 2023 15:57:25 +0200	[thread overview]
Message-ID: <20230817135725.2524796-3-ch@denx.de> (raw)
In-Reply-To: <20230817135725.2524796-1-ch@denx.de>

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):
-- 
2.30.2


  parent reply	other threads:[~2023-08-17 13:57 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 ` Claudius Heine [this message]
2023-08-17 14:06   ` [PATCH 2/2] meta/base.bbclass: integrate COMPATIBLE_MACHINE feature Anton Mikanovich
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=20230817135725.2524796-3-ch@denx.de \
    --to=ch@denx.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