summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-13 09:06:41 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-14 15:12:52 +0100
commit0fc41bdf07f6404bf92197d15e177cb7f3740228 (patch)
tree09372afa3244ad6756694fc89414149b60214992 /bitbake/lib/bb/cooker.py
parentffaf73eb9e1a147e1ded33e5cf2c0be381069f7f (diff)
downloadast2050-yocto-poky-0fc41bdf07f6404bf92197d15e177cb7f3740228.zip
ast2050-yocto-poky-0fc41bdf07f6404bf92197d15e177cb7f3740228.tar.gz
cooker: only return *Found events if something was actually found
The cooker methods which fire FooBarFound style events should only fire the event when an item was actually found, rather than each time the method is called. Fixes [YOCTO #1219] (Bitbake rev: 5c8eeefc79455f058dda8f04cf4c12dc5418e00f) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 1f6e093..8badd2d 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -549,14 +549,15 @@ class BBCooker:
def findConfigFilePath(self, configfile):
path = self._findConfigFile(configfile)
- bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
+ if path:
+ bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
def findFilesMatchingInDir(self, filepattern, directory):
"""
Searches for files matching the regex 'pattern' which are children of
'directory' in each BBPATH. i.e. to find all rootfs package classes available
to BitBake one could call findFilesMatchingInDir(self, 'rootfs_', 'classes')
- or to find all machine configuration files on could call
+ or to find all machine configuration files one could call:
findFilesMatchingInDir(self, 'conf/machines', 'conf')
"""
import re
@@ -572,7 +573,8 @@ class BBCooker:
if p.search(f):
matches.append(f)
- bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data)
+ if matches:
+ bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data)
def findConfigFiles(self, varname):
"""
@@ -595,7 +597,8 @@ class BBCooker:
if end == 'conf':
possible.append(val)
- bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data)
+ if possible:
+ bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data)
def findInheritsClass(self, klass):
"""
@@ -670,6 +673,7 @@ class BBCooker:
return confpath
path, _ = os.path.split(path)
+ return None
def _findLayerConf(self):
return self._findConfigFile("bblayers.conf")
OpenPOWER on IntegriCloud