diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-07-13 09:06:41 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-07-14 15:12:52 +0100 |
commit | 0fc41bdf07f6404bf92197d15e177cb7f3740228 (patch) | |
tree | 09372afa3244ad6756694fc89414149b60214992 /bitbake/lib | |
parent | ffaf73eb9e1a147e1ded33e5cf2c0be381069f7f (diff) | |
download | 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')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 1f6e093efb..8badd2d7c0 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -549,14 +549,15 @@ class BBCooker: | |||
549 | 549 | ||
550 | def findConfigFilePath(self, configfile): | 550 | def findConfigFilePath(self, configfile): |
551 | path = self._findConfigFile(configfile) | 551 | path = self._findConfigFile(configfile) |
552 | bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data) | 552 | if path: |
553 | bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data) | ||
553 | 554 | ||
554 | def findFilesMatchingInDir(self, filepattern, directory): | 555 | def findFilesMatchingInDir(self, filepattern, directory): |
555 | """ | 556 | """ |
556 | Searches for files matching the regex 'pattern' which are children of | 557 | Searches for files matching the regex 'pattern' which are children of |
557 | 'directory' in each BBPATH. i.e. to find all rootfs package classes available | 558 | 'directory' in each BBPATH. i.e. to find all rootfs package classes available |
558 | to BitBake one could call findFilesMatchingInDir(self, 'rootfs_', 'classes') | 559 | to BitBake one could call findFilesMatchingInDir(self, 'rootfs_', 'classes') |
559 | or to find all machine configuration files on could call | 560 | or to find all machine configuration files one could call: |
560 | findFilesMatchingInDir(self, 'conf/machines', 'conf') | 561 | findFilesMatchingInDir(self, 'conf/machines', 'conf') |
561 | """ | 562 | """ |
562 | import re | 563 | import re |
@@ -572,7 +573,8 @@ class BBCooker: | |||
572 | if p.search(f): | 573 | if p.search(f): |
573 | matches.append(f) | 574 | matches.append(f) |
574 | 575 | ||
575 | bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data) | 576 | if matches: |
577 | bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data) | ||
576 | 578 | ||
577 | def findConfigFiles(self, varname): | 579 | def findConfigFiles(self, varname): |
578 | """ | 580 | """ |
@@ -595,7 +597,8 @@ class BBCooker: | |||
595 | if end == 'conf': | 597 | if end == 'conf': |
596 | possible.append(val) | 598 | possible.append(val) |
597 | 599 | ||
598 | bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data) | 600 | if possible: |
601 | bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data) | ||
599 | 602 | ||
600 | def findInheritsClass(self, klass): | 603 | def findInheritsClass(self, klass): |
601 | """ | 604 | """ |
@@ -670,6 +673,7 @@ class BBCooker: | |||
670 | return confpath | 673 | return confpath |
671 | 674 | ||
672 | path, _ = os.path.split(path) | 675 | path, _ = os.path.split(path) |
676 | return None | ||
673 | 677 | ||
674 | def _findLayerConf(self): | 678 | def _findLayerConf(self): |
675 | return self._findConfigFile("bblayers.conf") | 679 | return self._findConfigFile("bblayers.conf") |