]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/utils: Improve get_multilib_datastore
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 2 Jul 2018 09:03:12 +0000 (09:03 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 2 Jul 2018 16:13:19 +0000 (17:13 +0100)
Currently this function assumes that no multilib is applied and that
we're applying a multilib. This means if we're in multilib context
and want the non-multilib context we can't obtain it (and no other
function exists for this either).

Improve the function to allow this to be requested.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/utils.py

index 80f0442d0aec9954135a38c9782596ae95239bda..6aed6dc993b370df8a03c7c2df33cd66a5848dc6 100644 (file)
@@ -327,9 +327,15 @@ def host_gcc_version(d):
 
 def get_multilib_datastore(variant, d):
     localdata = bb.data.createCopy(d)
-    overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + variant
-    localdata.setVar("OVERRIDES", overrides)
-    localdata.setVar("MLPREFIX", variant + "-")
+    if variant:
+        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + variant
+        localdata.setVar("OVERRIDES", overrides)
+        localdata.setVar("MLPREFIX", variant + "-")
+    else:
+        overrides = localdata.getVar("OVERRIDES", False).split(":")
+        overrides = ":".join([x for x in overrides if not x.startswith("virtclass-multilib-")])
+        localdata.setVar("OVERRIDES", overrides)
+        localdata.setVar("MLPREFIX", "")
     return localdata
 
 #