]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: event: adding generic event for metadata usage
authorAlexandru DAMIAN <alexandru.damian@intel.com>
Wed, 18 Sep 2013 12:15:52 +0000 (13:15 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 18 Sep 2013 14:14:13 +0000 (15:14 +0100)
Adding the generic bb.event.MetadataEvent that is
targeted specifically at metadata usage. This is
needed in order to let the metadata code send and receive
events during asynchrous execution without having
to define each event specifically in Bitbake.

Metadata code should subscribe to and fire the MetadataEvent
in order to communicate asynchronously, and identify
the object using event.type field, and parse the
data in the event.data field.

Knotty UI will ignore these event by default.

This deprecates RequestPackageInfo/PackageInfo, and that
event pair will be removed in the future.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/event.py
lib/bb/ui/knotty.py

index 67cfceaf5356615992d94cbdfc2ff1ed54492f21..10eae5fde87a33d2cc400fbaa48e0a53bdb19794 100644 (file)
@@ -589,6 +589,16 @@ class PackageInfo(Event):
         Event.__init__(self)
         self._pkginfolist = pkginfolist
 
+class MetadataEvent(Event):
+    """
+    Generic event that target for OE-Core classes
+    to report information during asynchrous execution
+    """
+    def __init__(self, eventtype, eventdata):
+        Event.__init__(self)
+        self.type = eventtype
+        self.data = eventdata
+
 class SanityCheck(Event):
     """
     Event to issue sanity check
index 0211b50abaa20d3feeca8d19a9c601c2df42ae65..c1ee9f5269de79e3a5202fa0f330b2df30e5304a 100644 (file)
@@ -477,6 +477,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
 
             # ignore
             if isinstance(event, (bb.event.BuildBase,
+                                  bb.event.MetadataEvent,
                                   bb.event.StampUpdate,
                                   bb.event.ConfigParsed,
                                   bb.event.RecipeParsed,