diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/providers.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py index d017d6006f..dcba9ae255 100644 --- a/bitbake/lib/bb/providers.py +++ b/bitbake/lib/bb/providers.py | |||
@@ -267,25 +267,29 @@ def filterProvidersRunTime(providers, item, cfgData, dataCache): | |||
267 | # Should use dataCache.preferred here? | 267 | # Should use dataCache.preferred here? |
268 | preferred = [] | 268 | preferred = [] |
269 | preferred_vars = [] | 269 | preferred_vars = [] |
270 | pns = {} | ||
271 | for p in eligible: | ||
272 | pns[dataCache.pkg_fn[p]] = p | ||
270 | for p in eligible: | 273 | for p in eligible: |
271 | pn = dataCache.pkg_fn[p] | 274 | pn = dataCache.pkg_fn[p] |
272 | provides = dataCache.pn_provides[pn] | 275 | provides = dataCache.pn_provides[pn] |
273 | for provide in provides: | 276 | for provide in provides: |
274 | logger.verbose("checking PREFERRED_PROVIDER_%s", provide) | ||
275 | prefervar = bb.data.getVar('PREFERRED_PROVIDER_%s' % provide, cfgData, 1) | 277 | prefervar = bb.data.getVar('PREFERRED_PROVIDER_%s' % provide, cfgData, 1) |
276 | if prefervar == pn: | 278 | logger.verbose("checking PREFERRED_PROVIDER_%s (value %s) against %s", provide, prefervar, pns.keys()) |
279 | if prefervar in pns and pns[prefervar] not in preferred: | ||
277 | var = "PREFERRED_PROVIDER_%s = %s" % (provide, prefervar) | 280 | var = "PREFERRED_PROVIDER_%s = %s" % (provide, prefervar) |
278 | logger.verbose("selecting %s to satisfy runtime %s due to %s", pn, item, var) | 281 | logger.verbose("selecting %s to satisfy runtime %s due to %s", prefervar, item, var) |
279 | preferred_vars.append(var) | 282 | preferred_vars.append(var) |
280 | eligible.remove(p) | 283 | pref = pns[prefervar] |
281 | eligible = [p] + eligible | 284 | eligible.remove(pref) |
282 | preferred.append(p) | 285 | eligible = [pref] + eligible |
286 | preferred.append(pref) | ||
283 | break | 287 | break |
284 | 288 | ||
285 | numberPreferred = len(preferred) | 289 | numberPreferred = len(preferred) |
286 | 290 | ||
287 | if numberPreferred > 1: | 291 | if numberPreferred > 1: |
288 | logger.error("Conflicting PREFERRED_PROVIDER entries were found which resulted in an attempt to select multiple providers (%s) for runtime dependecy %s\nThe entries resulting in this conflict were: %s", preferred, item, preferred_vars) | 292 | logger.error("Trying to resolve runtime dependency %s resulted in conflicting PREFERRED_PROVIDER entries being found.\nThe providers found were: %s\nThe PREFERRED_PROVIDER entries resulting in this conflict were: %s", item, preferred, preferred_vars) |
289 | 293 | ||
290 | logger.debug(1, "sorted providers for %s are: %s", item, eligible) | 294 | logger.debug(1, "sorted providers for %s are: %s", item, eligible) |
291 | 295 | ||