]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/utils: Improve all_multilib_tune_values
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 2 Jul 2018 08:59:34 +0000 (08:59 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 2 Jul 2018 16:13:19 +0000 (17:13 +0100)
Currently there is duplication in the code, we can clean this up
by extending the multilib variants list.

This code also currently fails its its called from an existing multilib
context since its assumes the data store passed in is the non-multilib
case. When building an image, say lib32-core-image-sato, this leads to
incorrect PATH values.

To fix this, we also request a data store for the "" variant allowing
this corner case to be fixed and for the function to correctly return
values for each multilib even when a multilib is already selected.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/utils.bbclass

index 3f4f51b56becf63c948b88b745844657d9341544..7035f9da253e3cbbe23218cd589e32a36d53e9ef 100644 (file)
@@ -328,15 +328,8 @@ def get_multilib_datastore(variant, d):
 def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '):
     """Return a string of all ${var} in all multilib tune configuration"""
     values = []
-    value = d.getVar(var) or ""
-    if value != "":
-        if need_split:
-            for item in value.split(delim):
-                values.append(item)
-        else:
-            values.append(value)
-    variants = d.getVar("MULTILIB_VARIANTS") or ""
-    for item in variants.split():
+    variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + ['']
+    for item in variants:
         localdata = get_multilib_datastore(item, d)
         # We need WORKDIR to be consistent with the original datastore
         localdata.setVar("WORKDIR", d.getVar("WORKDIR"))