[bitbake-devel] [PATCH 2/2] bb/cooker: only emit ConfigFilePathFound for files which were parsed

Joshua Lock josh at linux.intel.com
Tue Aug 2 18:51:16 UTC 2011


When the requested configuration file is found on disk check the
configuration object to ensure the file was parsed before emitting the
ConfigFilePathFound event. If it wasn't just return (and don't emit).

Fixes [YOCTO #1246]

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 lib/bb/cooker.py |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 025dfe4..a3456c3 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -609,9 +609,25 @@ 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:
+        if not path:
+            return
+
+        parsed_confs = bb.data.getVar('__BB_PARSED_CONF', self.configuration.data) or []
+        if path and path in parsed_confs:
             bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
+        elif path:
+            _, conf, conffile = path.rpartition("conf/")
+            match = os.path.join(conf, conffile)
+            # Try and find matches for conf/conffilename.conf
+            for cfg in parsed_confs:
+                if cfg.endswith(match):
+                    bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
+                    break
 
     def findFilesMatchingInDir(self, filepattern, directory):
         """
-- 
1.7.6





More information about the bitbake-devel mailing list