]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
providers: Fix PREFERRED_VERSION lookup for '_' in PN
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 26 Feb 2016 17:55:20 +0000 (17:55 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 28 Feb 2016 11:33:58 +0000 (11:33 +0000)
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>
lib/bb/providers.py

index 68c8d592d210b739842215b32129a0e181ebaf10..ffa532cff3a207efaa1c524d90d081ee552e88ba 100644 (file)
@@ -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: