summaryrefslogtreecommitdiffstats
path: root/meta
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:17:58 +0100
commitae213b252fb0b87ec3daaa2c78b794a3e17addb6 (patch)
tree8c9ce89ec392e6ff51be59ffb235fd3a4d69bc73 /meta
parentff6b14d03fbacc5d4f428cc455f5edda0295fb46 (diff)
downloadpoky-ae213b252fb0b87ec3daaa2c78b794a3e17addb6.tar.gz
base.bbclass: Ensure PREFERRED_PROVIDER and PREFERRED_VERSION values are set for multilibs
(From OE-Core rev: b12cd9f378eeafb6e23f379d5b005baa6e9a1a62) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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):
139 if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon": 139 if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon":
140 d.setVar("TUNE_PKGARCH", "armv7a") 140 d.setVar("TUNE_PKGARCH", "armv7a")
141 141
142def preferred_ml_updates(d):
143 # If any PREFERRED_PROVIDER or PREFERRED_VERSIONS are set,
144 # we need to mirror these variables in the multilib case
145 multilibs = d.getVar('MULTILIBS', True) or ""
146 if not multilibs:
147 return
148
149 prefixes = []
150 for ext in multilibs.split():
151 eext = ext.split(':')
152 if len(eext) > 1 and eext[0] == 'multilib':
153 prefixes.append(eext[1])
154
155 versions = []
156 providers = []
157 for v in d.keys():
158 if v.startswith("PREFERRED_VERSION_"):
159 versions.append(v)
160 if v.startswith("PREFERRED_PROVIDER_"):
161 providers.append(v)
162
163 for v in versions:
164 val = d.getVar(v, False)
165 pkg = v.replace("PREFERRED_VERSION_", "")
166 if pkg.endswith("-native") or pkg.endswith("-nativesdk"):
167 continue
168 for p in prefixes:
169 newname = "PREFERRED_VERSION_" + p + "-" + pkg
170 if not d.getVar(newname, False):
171 d.setVar(newname, val)
172
173 for prov in providers:
174 val = d.getVar(prov, False)
175 pkg = prov.replace("PREFERRED_PROVIDER_", "")
176 if pkg.endswith("-native") or pkg.endswith("-nativesdk"):
177 continue
178 virt = ""
179 if pkg.startswith("virtual/"):
180 pkg = pkg.replace("virtual/", "")
181 virt = "virtual/"
182 for p in prefixes:
183 newname = "PREFERRED_PROVIDER_" + virt + p + "-" + pkg
184 if not d.getVar(newname, False):
185 d.setVar(newname, p + "-" + val)
142 186
143addhandler base_eventhandler 187addhandler base_eventhandler
144python base_eventhandler() { 188python base_eventhandler() {
@@ -211,6 +255,7 @@ python base_eventhandler() {
211 if name == "ConfigParsed": 255 if name == "ConfigParsed":
212 generate_git_config(e) 256 generate_git_config(e)
213 pkgarch_mapping(e.data) 257 pkgarch_mapping(e.data)
258 preferred_ml_updates(e.data)
214 259
215 if not data in e.__dict__: 260 if not data in e.__dict__:
216 return 261 return