summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/providers.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-01-12 20:31:18 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-01-12 20:31:18 +0000
commitcf91cfaaa2ab909cb679bef3f8795e8bb89c96d4 (patch)
tree82862b3d91819346015c8a3af9dd497f814f0130 /bitbake/lib/bb/providers.py
parent5ab442890dcd83f6274b35435fa3be949a2b3321 (diff)
downloadopenembedded-core-cf91cfaaa2ab909cb679bef3f8795e8bb89c96d4.tar.gz
openembedded-core-cf91cfaaa2ab909cb679bef3f8795e8bb89c96d4.tar.bz2
openembedded-core-cf91cfaaa2ab909cb679bef3f8795e8bb89c96d4.zip
bitbake: Apply modified version of a patch from Martin Jansa <martin.jansa@gmail.com> to allow wildcards at the end of PREFERRED_VERSION strings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/providers.py')
-rw-r--r--bitbake/lib/bb/providers.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py
index dac0b9abf2..001281a293 100644
--- a/bitbake/lib/bb/providers.py
+++ b/bitbake/lib/bb/providers.py
@@ -63,6 +63,18 @@ def sortPriorities(pn, dataCache, pkg_pn = None):
return tmp_pn
+def preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
+ """
+ Check if the version pe,pv,pr is the preferred one.
+ If there is preferred version defined and ends with '%', then pv has to start with that version after removing the '%'
+ """
+ if (pr == preferred_r or preferred_r == None):
+ if (pe == preferred_e or preferred_e == None):
+ if preferred_v == pv:
+ return True
+ if preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]):
+ return True
+ return False
def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
"""
@@ -96,7 +108,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
for file_set in pkg_pn:
for f in file_set:
pe,pv,pr = dataCache.pkg_pepvpr[f]
- if preferred_v == pv and (preferred_r == pr or preferred_r == None) and (preferred_e == pe or preferred_e == None):
+ if preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
preferred_file = f
preferred_ver = (pe, pv, pr)
break