diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2013-03-19 15:20:59 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-04-03 17:01:12 +0100 |
commit | 805eede15761ef792b14afc4168f7d47c821dfd6 (patch) | |
tree | fa4377c488d4553edd4bfcaef2a459dea24cc410 /meta/classes/base.bbclass | |
parent | fd4e5c6c58183f1a017c6b5fe4d43c320e273567 (diff) | |
download | poky-805eede15761ef792b14afc4168f7d47c821dfd6.tar.gz |
base.bbclass: Update the preferred_ml_updates
When processing the blacklists, we should avoid cross-canadian packages, as they
will not have any multilib prefixes to expand.
Similarly look for "virtual/nativesdk-" in addition to the existing "nativesdk-".
These items should also be ignored.
Finally, in order to avoid undeterministic variable key expansion, such as:
MYVAR = "foo"
PREFERRED_PROVIDER_${MYVAR} = "bar"
PREFERRED_PROVIDER_foo = "foobar"
during the multilib processing of PREFERRED_VERSION and PREFERRED_PROVIDER,
the code was changed to rename the variable key, to the final key. This along
with the existing code avoids the problems.
(From OE-Core rev: 1416613e94af46c6e74532bca0f026d1540becbb)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 68720a4a91..abd6a526c3 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -162,7 +162,7 @@ def preferred_ml_updates(d): | |||
162 | providers.append(v) | 162 | providers.append(v) |
163 | 163 | ||
164 | for pkg, reason in blacklists.items(): | 164 | for pkg, reason in blacklists.items(): |
165 | if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith("nativesdk-") or 'cross-canadian' in pkg: | 165 | if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in pkg: |
166 | continue | 166 | continue |
167 | for p in prefixes: | 167 | for p in prefixes: |
168 | newpkg = p + "-" + pkg | 168 | newpkg = p + "-" + pkg |
@@ -172,7 +172,7 @@ def preferred_ml_updates(d): | |||
172 | for v in versions: | 172 | for v in versions: |
173 | val = d.getVar(v, False) | 173 | val = d.getVar(v, False) |
174 | pkg = v.replace("PREFERRED_VERSION_", "") | 174 | pkg = v.replace("PREFERRED_VERSION_", "") |
175 | if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith("nativesdk-"): | 175 | if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith(("nativesdk-", "virtual/nativesdk-")): |
176 | continue | 176 | continue |
177 | if 'cross-canadian' in pkg: | 177 | if 'cross-canadian' in pkg: |
178 | for p in prefixes: | 178 | for p in prefixes: |
@@ -182,8 +182,12 @@ def preferred_ml_updates(d): | |||
182 | bb.data.update_data(localdata) | 182 | bb.data.update_data(localdata) |
183 | newname = localdata.expand(v) | 183 | newname = localdata.expand(v) |
184 | if newname != v: | 184 | if newname != v: |
185 | newval = localdata.getVar(v, True) | 185 | newval = localdata.expand(val) |
186 | d.setVar(newname, newval) | 186 | d.setVar(newname, newval) |
187 | # Avoid future variable key expansion | ||
188 | vexp = d.expand(v) | ||
189 | if v != vexp and d.getVar(v, False): | ||
190 | d.renameVar(v, vexp) | ||
187 | continue | 191 | continue |
188 | for p in prefixes: | 192 | for p in prefixes: |
189 | newname = "PREFERRED_VERSION_" + p + "-" + pkg | 193 | newname = "PREFERRED_VERSION_" + p + "-" + pkg |
@@ -193,7 +197,7 @@ def preferred_ml_updates(d): | |||
193 | for prov in providers: | 197 | for prov in providers: |
194 | val = d.getVar(prov, False) | 198 | val = d.getVar(prov, False) |
195 | pkg = prov.replace("PREFERRED_PROVIDER_", "") | 199 | pkg = prov.replace("PREFERRED_PROVIDER_", "") |
196 | if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith("nativesdk-"): | 200 | if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith(("nativesdk-", "virtual/nativesdk-")): |
197 | continue | 201 | continue |
198 | if 'cross-canadian' in pkg: | 202 | if 'cross-canadian' in pkg: |
199 | for p in prefixes: | 203 | for p in prefixes: |
@@ -205,6 +209,10 @@ def preferred_ml_updates(d): | |||
205 | if newname != prov: | 209 | if newname != prov: |
206 | newval = localdata.expand(val) | 210 | newval = localdata.expand(val) |
207 | d.setVar(newname, newval) | 211 | d.setVar(newname, newval) |
212 | # Avoid future variable key expansion | ||
213 | provexp = d.expand(prov) | ||
214 | if prov != provexp and d.getVar(prov, False): | ||
215 | d.renameVar(prov, provexp) | ||
208 | continue | 216 | continue |
209 | virt = "" | 217 | virt = "" |
210 | if pkg.startswith("virtual/"): | 218 | if pkg.startswith("virtual/"): |
@@ -220,19 +228,23 @@ def preferred_ml_updates(d): | |||
220 | localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override) | 228 | localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override) |
221 | bb.data.update_data(localdata) | 229 | bb.data.update_data(localdata) |
222 | newname = localdata.expand(prov) | 230 | newname = localdata.expand(prov) |
223 | if newname != prov: | 231 | if newname != prov and not d.getVar(newname, False): |
224 | d.setVar(newname, localdata.expand(val)) | 232 | d.setVar(newname, localdata.expand(val)) |
225 | 233 | ||
226 | # implement alternative multilib name | 234 | # implement alternative multilib name |
227 | newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg) | 235 | newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg) |
228 | if not d.getVar(newname, False): | 236 | if not d.getVar(newname, False): |
229 | d.setVar(newname, val) | 237 | d.setVar(newname, val) |
238 | # Avoid future variable key expansion | ||
239 | provexp = d.expand(prov) | ||
240 | if prov != provexp and d.getVar(prov, False): | ||
241 | d.renameVar(prov, provexp) | ||
230 | 242 | ||
231 | 243 | ||
232 | mp = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split() | 244 | mp = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split() |
233 | extramp = [] | 245 | extramp = [] |
234 | for p in mp: | 246 | for p in mp: |
235 | if p.endswith(("-native", "-crosssdk")) or p.startswith("nativesdk-") or 'cross-canadian' in p: | 247 | if p.endswith(("-native", "-crosssdk")) or p.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in p: |
236 | continue | 248 | continue |
237 | virt = "" | 249 | virt = "" |
238 | if p.startswith("virtual/"): | 250 | if p.startswith("virtual/"): |