]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toasterui: close build on BuildCompleted event
authorAlexandru DAMIAN <alexandru.damian@intel.com>
Fri, 1 May 2015 15:42:39 +0000 (16:42 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 8 May 2015 16:42:05 +0000 (17:42 +0100)
Moving the code to close the build and instantiate a fresh
buildinfohelper object to BuildCompleted event, as the
CommandCompleted/Failed/Exit events come in too early.

(Bitbake rev: af63abe88327fd5c1b3d7c00a84d9e408ef23285)

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

index 6a7a1cd174bf17ed75d2df9d662ea3b58c889b73..30540483c3d05181ed7e1b7e2c60d954cb9a1b33 100644 (file)
@@ -236,22 +236,7 @@ def main(server, eventHandler, params ):
                 continue
 
             if isinstance(event, (bb.event.BuildCompleted)):
-                continue
-
-            if isinstance(event, (bb.command.CommandCompleted,
-                                  bb.command.CommandFailed,
-                                  bb.command.CommandExit)):
-                errorcode = 0
-                if (isinstance(event, bb.command.CommandFailed)):
-                    event.levelno = format.ERROR
-                    event.msg = "Command Failed " + event.error
-                    event.pathname = ""
-                    event.lineno = 0
-                    buildinfohelper.store_log_event(event)
-                    errors += 1
-                    errorcode = 1
-                    logger.error("Command execution failed: %s", event.error)
-
+                # update the build info helper on BuildCompleted, not on CommandXXX
                 buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
                 buildinfohelper.close(errorcode)
                 # mark the log output; controllers may kill the toasterUI after seeing this log
@@ -271,6 +256,23 @@ def main(server, eventHandler, params ):
 
                 continue
 
+            if isinstance(event, (bb.command.CommandCompleted,
+                                  bb.command.CommandFailed,
+                                  bb.command.CommandExit)):
+                errorcode = 0
+                if (isinstance(event, bb.command.CommandFailed)):
+                    event.levelno = format.ERROR
+                    event.msg = "Command Failed " + event.error
+                    event.pathname = ""
+                    event.lineno = 0
+                    buildinfohelper.store_log_event(event)
+                    errors += 1
+                    errorcode = 1
+                    logger.error("Command execution failed: %s", event.error)
+
+
+                continue
+
             if isinstance(event, bb.event.MetadataEvent):
                 if event.type == "SinglePackageInfo":
                     buildinfohelper.store_build_package_information(event)