summaryrefslogtreecommitdiffstats
path: root/meta/classes/utils.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-20 13:50:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-20 14:26:41 +0000
commit2a57e1334ff261a7ab45084be0f217e2acfe99af (patch)
treef5f97e466297d1201ad42da52cddaf262a3f12eb /meta/classes/utils.bbclass
parentce5c7075d530c0950f2feed35f95fbcd9f50721f (diff)
downloadopenembedded-core-contrib-2a57e1334ff261a7ab45084be0f217e2acfe99af.tar.gz
utils: Factor out common multilib datastore creation function
This code is already used in two places and we need it in others so turn it into its own function. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/utils.bbclass')
-rw-r--r--meta/classes/utils.bbclass20
1 files changed, 10 insertions, 10 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index d834a8a277d..549e4b82f5e 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -349,6 +349,14 @@ def multilib_pkg_extend(d, pkg):
pkgs = pkgs + " " + v + "-" + pkg
return pkgs
+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 + "-")
+ bb.data.update_data(localdata)
+ return localdata
+
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 = []
@@ -361,11 +369,7 @@ def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = '
values.append(value)
variants = d.getVar("MULTILIB_VARIANTS") 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)
+ localdata = get_multilib_datastore(item, d)
value = localdata.getVar(var) or ""
if value != "":
if need_split:
@@ -411,11 +415,7 @@ def all_multilib_tune_list(vars, d):
values[v].append(localdata.getVar(v))
variants = d.getVar("MULTILIB_VARIANTS") 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)
+ localdata = get_multilib_datastore(item, d)
values[v].append(localdata.getVar(v))
values['ml'].append(item)
return values