summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-01-06 17:02:28 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-06 15:55:57 +0000
commiteb2a8fe6c0c80632b1aa6d2bd8575ad8c2851133 (patch)
tree6d0480ee4846b57df5449aa4bf4671401576ad97
parent4c30a7e9a3fefca2b38a9ce813e67329bdd6e825 (diff)
downloadpoky-eb2a8fe6c0c80632b1aa6d2bd8575ad8c2851133.tar.gz
poky-eb2a8fe6c0c80632b1aa6d2bd8575ad8c2851133.tar.bz2
poky-eb2a8fe6c0c80632b1aa6d2bd8575ad8c2851133.zip
cooker: remove command import in cooker.py
There is no direct use of command in cooker.py, and it is using bb.command instead. Remove command in the import list. This fixes a problem of embedded import between command.py and cooker.py. (Bitbake rev: c353316b2efcc7a893d6b4aa9a9647d51a6f69e3) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/command.py11
-rw-r--r--bitbake/lib/bb/cooker.py12
-rw-r--r--bitbake/lib/bb/event.py8
3 files changed, 31 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 701b286187..bd41f5418a 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -238,6 +238,17 @@ class CommandsAsync:
command.finishAsyncCommand()
generateTargetsTree.needcache = True
+ def findCoreBaseFiles(self, command, params):
+ """
+ Find certain files in COREBASE directory. i.e. Layers
+ """
+ subdir = params[0]
+ filename = params[1]
+
+ command.cooker.findCoreBaseFiles(subdir, filename)
+ command.finishAsyncCommand()
+ findCoreBaseFiles.needcache = False
+
def findConfigFiles(self, command, params):
"""
Find config files which provide appropriate values
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 102d40fda0..203271868a 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -641,6 +641,18 @@ class BBCooker:
if regex in unmatched:
collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern))
+ def findCoreBaseFiles(self, subdir, configfile):
+ corebase = self.configuration.data.getVar('COREBASE', True) or ""
+ paths = []
+ for root, dirs, files in os.walk(corebase + '/' + subdir):
+ for d in dirs:
+ configfilepath = os.path.join(root, d, configfile)
+ if os.path.exists(configfilepath):
+ paths.append(os.path.join(root, d))
+
+ if paths:
+ bb.event.fire(bb.event.CoreBaseFilesFound(paths), self.configuration.data)
+
def findConfigFilePath(self, configfile):
"""
Find the location on disk of configfile and if it exists and was parsed by BitBake
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 088cd7c097..8d7f9413e0 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -402,6 +402,14 @@ class FilesMatchingFound(Event):
self._pattern = pattern
self._matches = matches
+class CoreBaseFilesFound(Event):
+ """
+ Event when a list of appropriate config files has been generated
+ """
+ def __init__(self, paths):
+ Event.__init__(self)
+ self._paths = paths
+
class ConfigFilesFound(Event):
"""
Event when a list of appropriate config files has been generated