diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2012-01-06 17:02:28 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-06 15:55:57 +0000 |
commit | eb2a8fe6c0c80632b1aa6d2bd8575ad8c2851133 (patch) | |
tree | 6d0480ee4846b57df5449aa4bf4671401576ad97 /bitbake | |
parent | 4c30a7e9a3fefca2b38a9ce813e67329bdd6e825 (diff) | |
download | poky-eb2a8fe6c0c80632b1aa6d2bd8575ad8c2851133.tar.gz |
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>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/command.py | 11 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bb/event.py | 8 |
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: | |||
238 | command.finishAsyncCommand() | 238 | command.finishAsyncCommand() |
239 | generateTargetsTree.needcache = True | 239 | generateTargetsTree.needcache = True |
240 | 240 | ||
241 | def findCoreBaseFiles(self, command, params): | ||
242 | """ | ||
243 | Find certain files in COREBASE directory. i.e. Layers | ||
244 | """ | ||
245 | subdir = params[0] | ||
246 | filename = params[1] | ||
247 | |||
248 | command.cooker.findCoreBaseFiles(subdir, filename) | ||
249 | command.finishAsyncCommand() | ||
250 | findCoreBaseFiles.needcache = False | ||
251 | |||
241 | def findConfigFiles(self, command, params): | 252 | def findConfigFiles(self, command, params): |
242 | """ | 253 | """ |
243 | Find config files which provide appropriate values | 254 | 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: | |||
641 | if regex in unmatched: | 641 | if regex in unmatched: |
642 | collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern)) | 642 | collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern)) |
643 | 643 | ||
644 | def findCoreBaseFiles(self, subdir, configfile): | ||
645 | corebase = self.configuration.data.getVar('COREBASE', True) or "" | ||
646 | paths = [] | ||
647 | for root, dirs, files in os.walk(corebase + '/' + subdir): | ||
648 | for d in dirs: | ||
649 | configfilepath = os.path.join(root, d, configfile) | ||
650 | if os.path.exists(configfilepath): | ||
651 | paths.append(os.path.join(root, d)) | ||
652 | |||
653 | if paths: | ||
654 | bb.event.fire(bb.event.CoreBaseFilesFound(paths), self.configuration.data) | ||
655 | |||
644 | def findConfigFilePath(self, configfile): | 656 | def findConfigFilePath(self, configfile): |
645 | """ | 657 | """ |
646 | Find the location on disk of configfile and if it exists and was parsed by BitBake | 658 | 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): | |||
402 | self._pattern = pattern | 402 | self._pattern = pattern |
403 | self._matches = matches | 403 | self._matches = matches |
404 | 404 | ||
405 | class CoreBaseFilesFound(Event): | ||
406 | """ | ||
407 | Event when a list of appropriate config files has been generated | ||
408 | """ | ||
409 | def __init__(self, paths): | ||
410 | Event.__init__(self) | ||
411 | self._paths = paths | ||
412 | |||
405 | class ConfigFilesFound(Event): | 413 | class ConfigFilesFound(Event): |
406 | """ | 414 | """ |
407 | Event when a list of appropriate config files has been generated | 415 | Event when a list of appropriate config files has been generated |