summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/providers.py
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-08-15 08:39:19 +0000
committerRichard Purdie <richard@openedhand.com>2007-08-15 08:39:19 +0000
commit75306742144eb1bd2d57c986d1f836a59a1f0e8b (patch)
treed1a15e84c1ae3c5c2dff906bbdba3d12bf5186e3 /bitbake/lib/bb/providers.py
parentd7892c265b0e820a28e62a4aa0819d90ea354a5b (diff)
downloadpoky-75306742144eb1bd2d57c986d1f836a59a1f0e8b.tar.gz
bitbake: Sync with upstream 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2497 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/providers.py')
-rw-r--r--bitbake/lib/bb/providers.py63
1 files changed, 61 insertions, 2 deletions
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py
index 81de85e760..e6f08fb4bd 100644
--- a/bitbake/lib/bb/providers.py
+++ b/bitbake/lib/bb/providers.py
@@ -120,7 +120,7 @@ def findBestProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
120 120
121 return (latest,latest_f,preferred_ver, preferred_file) 121 return (latest,latest_f,preferred_ver, preferred_file)
122 122
123def filterProviders(providers, item, cfgData, dataCache): 123def _filterProviders(providers, item, cfgData, dataCache):
124 """ 124 """
125 Take a list of providers and filter/reorder according to the 125 Take a list of providers and filter/reorder according to the
126 environment variables and previous build results 126 environment variables and previous build results
@@ -128,6 +128,11 @@ def filterProviders(providers, item, cfgData, dataCache):
128 eligible = [] 128 eligible = []
129 preferred_versions = {} 129 preferred_versions = {}
130 130
131 # The order of providers depends on the order of the files on the disk
132 # up to here. Sort pkg_pn to make dependency issues reproducible rather
133 # than effectively random.
134 providers.sort()
135
131 # Collate providers by PN 136 # Collate providers by PN
132 pkg_pn = {} 137 pkg_pn = {}
133 for p in providers: 138 for p in providers:
@@ -187,7 +192,61 @@ def filterProviders(providers, item, cfgData, dataCache):
187 eligible = [fn] + eligible 192 eligible = [fn] + eligible
188 break 193 break
189 194
190 return eligible 195 return eligible, preferred_versions
196
197
198def filterProviders(providers, item, cfgData, dataCache):
199 """
200 Take a list of providers and filter/reorder according to the
201 environment variables and previous build results
202 Takes a "normal" target item
203 """
204
205 eligible, pref_vers = _filterProviders(providers, item, cfgData, dataCache)
206
207 prefervar = bb.data.getVar('PREFERRED_PROVIDER_%s' % item, cfgData, 1)
208 if prefervar:
209 dataCache.preferred[item] = prefervar
210
211 foundUnique = False
212 if item in dataCache.preferred:
213 for p in eligible:
214 pn = dataCache.pkg_fn[p]
215 if dataCache.preferred[item] == pn:
216 bb.msg.note(2, bb.msg.domain.Provider, "selecting %s to satisfy %s due to PREFERRED_PROVIDERS" % (pn, item))
217 eligible.remove(p)
218 eligible = [p] + eligible
219 foundUnique = True
220 break
221
222 return eligible, foundUnique
223
224def filterProvidersRunTime(providers, item, cfgData, dataCache):
225 """
226 Take a list of providers and filter/reorder according to the
227 environment variables and previous build results
228 Takes a "runtime" target item
229 """
230
231 eligible, pref_vers = _filterProviders(providers, item, cfgData, dataCache)
232
233 # Should use dataCache.preferred here?
234 preferred = []
235 for p in eligible:
236 pn = dataCache.pkg_fn[p]
237 provides = dataCache.pn_provides[pn]
238 for provide in provides:
239 prefervar = bb.data.getVar('PREFERRED_PROVIDER_%s' % provide, cfgData, 1)
240 if prefervar == pn:
241 bb.msg.note(2, bb.msg.domain.Provider, "selecting %s to satisfy runtime %s due to PREFERRED_PROVIDERS" % (pn, item))
242 eligible.remove(p)
243 eligible = [p] + eligible
244 preferred.append(p)
245 break
246
247 numberPreferred = len(preferred)
248
249 return eligible, numberPreferred
191 250
192def getRuntimeProviders(dataCache, rdepend): 251def getRuntimeProviders(dataCache, rdepend):
193 """ 252 """