summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-09 09:23:36 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-10 13:38:20 +0100
commit786033f53cad2a196ae6f3a05574148578ea3894 (patch)
tree5d11bcb409c89cef3e9636159703e15b79ef56c2 /bitbake/lib/bb/cooker.py
parent6bb2a22b3606f2cf1e5a4c95414d82864fda2f31 (diff)
downloadast2050-yocto-poky-786033f53cad2a196ae6f3a05574148578ea3894.zip
ast2050-yocto-poky-786033f53cad2a196ae6f3a05574148578ea3894.tar.gz
bb/cooker: only emit ConfigFilePathFound for files which were parsed
When the requested configuration file is found on disk check the against the configuration files in __depends/__base_depends to ensure the file was parsed before emitting the ConfigFilePathFound event. If the requested file wasn't parsed just return (and don't emit). Fixes [YOCTO #1246] (Bitbake rev: 705d14d1e1108e0544c7eab827f1242f0839add9) 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.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 4c13d32..46b42e6 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -615,9 +615,33 @@ class BBCooker:
collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern))
def findConfigFilePath(self, configfile):
+ """
+ Find the location on disk of configfile and if it exists and was parsed by BitBake
+ emit the ConfigFilePathFound event with the path to the file.
+ """
path = self._findConfigFile(configfile)
- if path:
- bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
+ if not path:
+ return
+
+ # Generate a list of parsed configuration files by searching the files
+ # listed in the __depends and __base_depends variables with a .conf suffix.
+ conffiles = []
+ dep_files = bb.data.getVar('__depends', self.configuration.data) or set()
+ dep_files.union(bb.data.getVar('__base_depends', self.configuration.data) or set())
+
+ for f in dep_files:
+ if f[0].endswith(".conf"):
+ conffiles.append(f[0])
+
+ _, conf, conffile = path.rpartition("conf/")
+ match = os.path.join(conf, conffile)
+ # Try and find matches for conf/conffilename.conf as we don't always
+ # have the full path to the file.
+ for cfg in conffiles:
+ if cfg.endswith(match):
+ bb.event.fire(bb.event.ConfigFilePathFound(path),
+ self.configuration.data)
+ break
def findFilesMatchingInDir(self, filepattern, directory):
"""
OpenPOWER on IntegriCloud