Browse Source

lib/oe/utils: Improve get_multilib_datastore

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.

(From OE-Core rev: 295c5a3d19834a2fac255346d0a373449cfdd776)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 7 years ago
parent
commit
e9e1107c61
1 changed files with 9 additions and 3 deletions
  1. 9 3
      meta/lib/oe/utils.py

+ 9 - 3
meta/lib/oe/utils.py

@@ -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
 
 #