summaryrefslogtreecommitdiffstats
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)
downloadpoky-cf91cfaaa2ab909cb679bef3f8795e8bb89c96d4.tar.gz
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):
63 63
64 return tmp_pn 64 return tmp_pn
65 65
66def preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
67 """
68 Check if the version pe,pv,pr is the preferred one.
69 If there is preferred version defined and ends with '%', then pv has to start with that version after removing the '%'
70 """
71 if (pr == preferred_r or preferred_r == None):
72 if (pe == preferred_e or preferred_e == None):
73 if preferred_v == pv:
74 return True
75 if preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]):
76 return True
77 return False
66 78
67def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None): 79def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
68 """ 80 """
@@ -96,7 +108,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
96 for file_set in pkg_pn: 108 for file_set in pkg_pn:
97 for f in file_set: 109 for f in file_set:
98 pe,pv,pr = dataCache.pkg_pepvpr[f] 110 pe,pv,pr = dataCache.pkg_pepvpr[f]
99 if preferred_v == pv and (preferred_r == pr or preferred_r == None) and (preferred_e == pe or preferred_e == None): 111 if preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
100 preferred_file = f 112 preferred_file = f
101 preferred_ver = (pe, pv, pr) 113 preferred_ver = (pe, pv, pr)
102 break 114 break