diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-20 13:50:47 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-20 14:26:41 +0000 |
commit | 2a57e1334ff261a7ab45084be0f217e2acfe99af (patch) | |
tree | f5f97e466297d1201ad42da52cddaf262a3f12eb /meta | |
parent | ce5c7075d530c0950f2feed35f95fbcd9f50721f (diff) | |
download | openembedded-core-2a57e1334ff261a7ab45084be0f217e2acfe99af.tar.gz openembedded-core-2a57e1334ff261a7ab45084be0f217e2acfe99af.tar.bz2 openembedded-core-2a57e1334ff261a7ab45084be0f217e2acfe99af.zip |
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')
-rw-r--r-- | meta/classes/utils.bbclass | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index d834a8a277..549e4b82f5 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 |