aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/providers.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-26 17:55:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-28 11:33:58 +0000
commit7a6baf02617d1edced4eaff235e73d746e2a3b68 (patch)
treee6389804883ecf308d9b15e8733268ee38533f71 /lib/bb/providers.py
parent48e903745db578d9b9b425a8d411c1369df0eb94 (diff)
downloadbitbake-7a6baf02617d1edced4eaff235e73d746e2a3b68.tar.gz
providers: Fix PREFERRED_VERSION lookup for '_' in PN
PN can contain '_', e.g. gcc-cross-x86_64 and an override cannot hence we do this manually rather than use OVERRIDES. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/providers.py')
-rw-r--r--lib/bb/providers.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/bb/providers.py b/lib/bb/providers.py
index 68c8d592d..ffa532cff 100644
--- a/lib/bb/providers.py
+++ b/lib/bb/providers.py
@@ -121,11 +121,14 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
preferred_file = None
preferred_ver = None
- localdata = data.createCopy(cfgData)
- localdata.setVar('OVERRIDES', "%s:pn-%s:%s" % (data.getVar('OVERRIDES', localdata), pn, pn))
- bb.data.update_data(localdata)
+ # pn can contain '_', e.g. gcc-cross-x86_64 and an override cannot
+ # hence we do this manually rather than use OVERRIDES
+ preferred_v = cfgData.getVar("PREFERRED_VERSION_pn-%s" % pn, True)
+ if not preferred_v:
+ preferred_v = cfgData.getVar("PREFERRED_VERSION_%s" % pn, True)
+ if not preferred_v:
+ preferred_v = cfgData.getVar("PREFERRED_VERSION", True)
- preferred_v = localdata.getVar('PREFERRED_VERSION', True)
if preferred_v:
m = re.match('(\d+:)*(.*)(_.*)*', preferred_v)
if m: