summaryrefslogtreecommitdiffstats
path: root/lib/bb/providers.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2006-08-14 00:22:37 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2006-08-14 00:22:37 +0000
commit9019bfe861522f7fb9d9759d91cc3ea66f909ad5 (patch)
tree6c53b8be8a7dd0a6276c54d9c7aa100c353a3565 /lib/bb/providers.py
parent3639a965293f5b60efec38b5489b574076a5d3b6 (diff)
downloadbitbake-9019bfe861522f7fb9d9759d91cc3ea66f909ad5.tar.gz
trunk/bitbake/lib/bb/providers.py:
trunk/bitbake/bin/bitbake: * Move getProvidersRun -> bb.providers.getRuntimeProviders * Make filterProviders build_cache_fail parameter optional, pending rethink/removal * Add NoProvider exception
Diffstat (limited to 'lib/bb/providers.py')
-rw-r--r--lib/bb/providers.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/bb/providers.py b/lib/bb/providers.py
index b97b3ee9d..02f45ddc3 100644
--- a/lib/bb/providers.py
+++ b/lib/bb/providers.py
@@ -7,6 +7,7 @@
# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
# Copyright (C) 2005 Holger Hans Peter Freyther
# Copyright (C) 2005 ROAD GmbH
+# Copyright (C) 2006 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
@@ -25,6 +26,9 @@ import os, re
from bb import data, utils
import bb
+class NoProvider(Exception):
+ """Exception raised when no provider can be found"""
+
def findBestProvider(pn, cfgData, dataCache, pkg_pn = None):
"""
If there is a PREFERRED_VERSION, find the highest-priority bbfile
@@ -101,7 +105,10 @@ def findBestProvider(pn, cfgData, dataCache, pkg_pn = None):
return (latest,latest_f,preferred_ver, preferred_file)
-def filterProviders(providers, item, cfgData, dataCache, build_cache_fail):
+#
+# RP - build_cache_fail needs to move elsewhere
+#
+def filterProviders(providers, item, cfgData, dataCache, build_cache_fail = {}):
"""
Take a list of providers and filter/reorder according to the
environment variables and previous build results
@@ -160,3 +167,25 @@ def filterProviders(providers, item, cfgData, dataCache, build_cache_fail):
return eligible
+def getRuntimeProviders(dataCache, rdepend):
+ """
+ Return any providers of runtime dependency
+ """
+ rproviders = []
+
+ if rdepend in dataCache.rproviders:
+ rproviders += dataCache.rproviders[rdepend]
+
+ if rdepend in dataCache.packages:
+ rproviders += dataCache.packages[rdepend]
+
+ if rproviders:
+ return rproviders
+
+ # Only search dynamic packages if we can't find anything in other variables
+ for pattern in dataCache.packages_dynamic:
+ regexp = re.compile(pattern)
+ if regexp.match(rdepend):
+ rproviders += dataCache.packages_dynamic[pattern]
+
+ return rproviders