summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-05 14:51:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-09 15:16:31 +0100
commitb12cd9f378eeafb6e23f379d5b005baa6e9a1a62 (patch)
tree672e1a42f41d72f66cae6c21224224e954632b0c
parentb91fbc597c182dcbd514639a24c575b0cccc8741 (diff)
downloadopenembedded-core-b12cd9f378eeafb6e23f379d5b005baa6e9a1a62.tar.gz
openembedded-core-b12cd9f378eeafb6e23f379d5b005baa6e9a1a62.tar.bz2
openembedded-core-b12cd9f378eeafb6e23f379d5b005baa6e9a1a62.zip
base.bbclass: Ensure PREFERRED_PROVIDER and PREFERRED_VERSION values are set for multilibs
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index ff960cd0e3..e686652f16 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -139,6 +139,50 @@ def pkgarch_mapping(d):
if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon":
d.setVar("TUNE_PKGARCH", "armv7a")
+def preferred_ml_updates(d):
+ # If any PREFERRED_PROVIDER or PREFERRED_VERSIONS are set,
+ # we need to mirror these variables in the multilib case
+ multilibs = d.getVar('MULTILIBS', True) or ""
+ if not multilibs:
+ return
+
+ prefixes = []
+ for ext in multilibs.split():
+ eext = ext.split(':')
+ if len(eext) > 1 and eext[0] == 'multilib':
+ prefixes.append(eext[1])
+
+ versions = []
+ providers = []
+ for v in d.keys():
+ if v.startswith("PREFERRED_VERSION_"):
+ versions.append(v)
+ if v.startswith("PREFERRED_PROVIDER_"):
+ providers.append(v)
+
+ for v in versions:
+ val = d.getVar(v, False)
+ pkg = v.replace("PREFERRED_VERSION_", "")
+ if pkg.endswith("-native") or pkg.endswith("-nativesdk"):
+ continue
+ for p in prefixes:
+ newname = "PREFERRED_VERSION_" + p + "-" + pkg
+ if not d.getVar(newname, False):
+ d.setVar(newname, val)
+
+ for prov in providers:
+ val = d.getVar(prov, False)
+ pkg = prov.replace("PREFERRED_PROVIDER_", "")
+ if pkg.endswith("-native") or pkg.endswith("-nativesdk"):
+ continue
+ virt = ""
+ if pkg.startswith("virtual/"):
+ pkg = pkg.replace("virtual/", "")
+ virt = "virtual/"
+ for p in prefixes:
+ newname = "PREFERRED_PROVIDER_" + virt + p + "-" + pkg
+ if not d.getVar(newname, False):
+ d.setVar(newname, p + "-" + val)
addhandler base_eventhandler
python base_eventhandler() {
@@ -211,6 +255,7 @@ python base_eventhandler() {
if name == "ConfigParsed":
generate_git_config(e)
pkgarch_mapping(e.data)
+ preferred_ml_updates(e.data)
if not data in e.__dict__:
return