diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2006-08-14 00:22:37 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2006-08-14 00:22:37 +0000 |
commit | 9019bfe861522f7fb9d9759d91cc3ea66f909ad5 (patch) | |
tree | 6c53b8be8a7dd0a6276c54d9c7aa100c353a3565 | |
parent | 3639a965293f5b60efec38b5489b574076a5d3b6 (diff) | |
download | bitbake-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
-rwxr-xr-x | bin/bitbake | 29 | ||||
-rw-r--r-- | lib/bb/providers.py | 31 |
2 files changed, 33 insertions, 27 deletions
diff --git a/bin/bitbake b/bin/bitbake index 5abcfc3e2..2c8a6a291 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -501,12 +501,12 @@ class BBCooker: providers = self.status.providers[package] elif package in the_rdepends: - if len(self.getProvidersRun(package)) == 0: + if len(bb.providers.getRuntimeProviders(package)) == 0: bb.note( "ERROR with rprovider: %(package)s" % vars() ) print >> alldepends_file, '"%(package)s" -> ERROR [style="dashed"]' % vars() continue - providers = self.getProvidersRun(package) + providers = bb.providers.getRuntimeProviders(package) else: # something went wrong... print "Complete ERROR! %s" % package @@ -624,7 +624,7 @@ class BBCooker: if not buildAllDeps: return True - all_p = self.getProvidersRun(item) + all_p = bb.providers.getRuntimeProviders(item) if not all_p: bb.msg.error(bb.msg.domain.Provider, "Nothing provides runtime dependency %s" % (item)) @@ -685,29 +685,6 @@ class BBCooker: bb.event.fire(bb.event.NoProvider(item,self.configuration.data)) return False - def getProvidersRun(self, rdepend): - """ - Return any potential providers of runtime rdepend - """ - rproviders = [] - - if rdepend in self.status.rproviders: - rproviders += self.status.rproviders[rdepend] - - if rdepend in self.status.packages: - rproviders += self.status.packages[rdepend] - - if rproviders: - return rproviders - - # Only search dynamic packages if we can't find anything in other variables - for pattern in self.status.packages_dynamic: - regexp = re.compile(pattern) - if regexp.match(rdepend): - rproviders += self.status.packages_dynamic[pattern] - - return rproviders - def addRunDeps(self , fn, item , buildAllDeps): """ Add any runtime dependencies of runtime item provided by fn 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 |