]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
mcextend: Add helper class useful for multiconfig
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 2 Mar 2019 14:34:01 +0000 (14:34 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 3 Mar 2019 15:38:08 +0000 (15:38 +0000)
This class allows users to easily create multiconfig BBCLASSEXTEND recipes
and is generally useful. It will be used by new tests so add as a general
feature.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/mcextend.bbclass [new file with mode: 0644]

diff --git a/meta/classes/mcextend.bbclass b/meta/classes/mcextend.bbclass
new file mode 100644 (file)
index 0000000..0f8f962
--- /dev/null
@@ -0,0 +1,16 @@
+python mcextend_virtclass_handler () {
+    cls = e.data.getVar("BBEXTENDCURR")
+    variant = e.data.getVar("BBEXTENDVARIANT")
+    if cls != "mcextend" or not variant:
+        return
+
+    override = ":virtclass-mcextend-" + variant
+
+    e.data.setVar("PN", e.data.getVar("PN", False) + "-" + variant)
+    e.data.setVar("MCNAME", variant)
+    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
+}
+
+addhandler mcextend_virtclass_handler
+mcextend_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
+