[bitbake-devel] [RFC PATCH 2/3] cooker|event: notify if pre/post file in ConfigFilePathFound event

Joshua Lock josh at linux.intel.com
Wed Jul 27 04:46:10 UTC 2011


When findConfigFilePath called the emitted ConfigFilePathFound event will
also include a boolean value indiciating whether the specified config file
was loaded using the prefile or postfile options to BitBake.

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 lib/bb/cooker.py |    7 ++++++-
 lib/bb/event.py  |    3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 765c58d..f0c07b5 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -605,9 +605,14 @@ class BBCooker:
                 collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern))
 
     def findConfigFilePath(self, configfile):
+        additional = False
         path = self._findConfigFile(configfile)
         if path:
-            bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
+            for path in self.extraconf:
+                _, cf, _ = path.rpartition(configfile)
+                if cf:
+                    additional = True
+            bb.event.fire(bb.event.ConfigFilePathFound(path, additional), self.configuration.data)
 
     def findFilesMatchingInDir(self, filepattern, directory):
         """
diff --git a/lib/bb/event.py b/lib/bb/event.py
index 93c04ba..01700dc 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -412,9 +412,10 @@ class ConfigFilePathFound(Event):
     """
     Event when a path for a config file has been found
     """
-    def __init__(self, path):
+    def __init__(self, path, extraconf):
         Event.__init__(self)
         self._path = path
+        self._extraconf = extraconf
 
 class MsgBase(Event):
     """Base class for messages"""
-- 
1.7.6





More information about the bitbake-devel mailing list