summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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:
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
405class 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
405class ConfigFilesFound(Event): 413class 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