[oe-commits] [openembedded-core] 04/20: utils: Add all_multilib_tune_list function
git at git.openembedded.org
git at git.openembedded.org
Tue Sep 27 08:13:55 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 9be3b10b5619307bf421124dd34074246a907883
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Sep 26 17:22:24 2016 +0100
utils: Add all_multilib_tune_list function
Its useful to be able to query a list of variables to obtain the values
in each multilib context. This adds such a function which works even
if called in the non-default recipe context.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/utils.bbclass | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 3c2a14f..74c5059 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -382,3 +382,36 @@ def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = '
else:
ret = values
return " ".join(ret)
+
+def all_multilib_tune_list(d, var):
+ """
+ Return a list of ${var} from each multilib tune configurations
+ Is safe to be called from a multilib recipe/context as it can
+ figure out the original tune and remove the multilib overrides.
+ """
+ values = []
+
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False).split(":")
+ newoverrides = []
+ for o in overrides:
+ if not o.startswith("virtclass-multilib-"):
+ newoverrides.append(o)
+ localdata.setVar("OVERRIDES", ":".join(newoverrides))
+ localdata.setVar("MLPREFIX", "")
+ origdefault = localdata.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL", True)
+ if origdefault:
+ localdata.setVar("DEFAULTTUNE", origdefault)
+ bb.data.update_data(localdata)
+ value = localdata.getVar(var, True)
+ values.append(value)
+ variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+ for item in variants.split():
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ localdata.setVar("MLPREFIX", item + "-")
+ bb.data.update_data(localdata)
+ value = localdata.getVar(var, True)
+ values.append(value)
+ return values
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list