Patchwork [bitbake-devel,30/32] Hob: Fix pressing "stop" build

login
register
mail settings
Submitter Shane Wang
Date Feb. 29, 2012, 2:15 p.m.
Message ID <8215fe641661f250180c87d726073c0450e191b7.1330523904.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/22483/
State New
Headers show

Comments

Shane Wang - Feb. 29, 2012, 2:15 p.m.
From: Dongxiao Xu <dongxiao.xu@intel.com>

This commit fixes the behavior of clicking stop build button, it will
stay in the build detail screen and show build is failed.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
Joshua Lock - Feb. 29, 2012, 9:29 p.m.
On 29/02/12 06:15, Shane Wang wrote:
> From: Dongxiao Xu<dongxiao.xu@intel.com>
>
> This commit fixes the behavior of clicking stop build button, it will
> stay in the build detail screen and show build is failed.
>
> Signed-off-by: Dongxiao Xu<dongxiao.xu@intel.com>

Signed-off-by: Joshua Lock <josh@linux.intel.com>

> ---
>   bitbake/lib/bb/ui/crumbs/builder.py |   18 +++++++++++++-----
>   1 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
> index f41b6a4..a04d6fa 100755
> --- a/bitbake/lib/bb/ui/crumbs/builder.py
> +++ b/bitbake/lib/bb/ui/crumbs/builder.py
> @@ -193,7 +193,6 @@ class Builder(gtk.Window):
>           self.previous_step = None
>
>           self.stopping = False
> -        self.build_succeeded = True
>
>           # recipe model and package model
>           self.recipe_model = recipe_model
> @@ -533,8 +532,7 @@ class Builder(gtk.Window):
>           self.build_details_page.update_progress_bar("Build Started: ", fraction)
>           self.build_details_page.reset_issues()
>
> -    def handler_build_succeeded_cb(self, running_build):
> -        self.build_succeeded = True
> +    def build_succeeded(self):
>           if self.current_step == self.FAST_IMAGE_GENERATING:
>               fraction = 0.9
>           elif self.current_step == self.IMAGE_GENERATING:
> @@ -548,9 +546,9 @@ class Builder(gtk.Window):
>           elif self.current_step == self.PACKAGE_GENERATING:
>               fraction = 1.0
>           self.build_details_page.update_progress_bar("Build Completed: ", fraction)
> +        self.stopping = False
>
> -    def handler_build_failed_cb(self, running_build):
> -        self.build_succeeded = False
> +    def build_failed(self):
>           if self.current_step == self.FAST_IMAGE_GENERATING:
>               fraction = 0.9
>           elif self.current_step == self.IMAGE_GENERATING:
> @@ -563,6 +561,16 @@ class Builder(gtk.Window):
>           self.handler.build_failed_async()
>           self.stopping = False
>
> +    def handler_build_succeeded_cb(self, running_build):
> +        if not self.stopping:
> +            self.build_succeeded()
> +        else:
> +            self.build_failed()
> +
> +
> +    def handler_build_failed_cb(self, running_build):
> +        self.build_failed()
> +
>       def handler_task_started_cb(self, running_build, message):
>           fraction = message["current"] * 1.0/message["total"]
>           title = "Build packages"

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index f41b6a4..a04d6fa 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -193,7 +193,6 @@  class Builder(gtk.Window):
         self.previous_step = None
 
         self.stopping = False
-        self.build_succeeded = True
 
         # recipe model and package model
         self.recipe_model = recipe_model
@@ -533,8 +532,7 @@  class Builder(gtk.Window):
         self.build_details_page.update_progress_bar("Build Started: ", fraction)
         self.build_details_page.reset_issues()
 
-    def handler_build_succeeded_cb(self, running_build):
-        self.build_succeeded = True
+    def build_succeeded(self):
         if self.current_step == self.FAST_IMAGE_GENERATING:
             fraction = 0.9
         elif self.current_step == self.IMAGE_GENERATING:
@@ -548,9 +546,9 @@  class Builder(gtk.Window):
         elif self.current_step == self.PACKAGE_GENERATING:
             fraction = 1.0
         self.build_details_page.update_progress_bar("Build Completed: ", fraction)
+        self.stopping = False
 
-    def handler_build_failed_cb(self, running_build):
-        self.build_succeeded = False
+    def build_failed(self):
         if self.current_step == self.FAST_IMAGE_GENERATING:
             fraction = 0.9
         elif self.current_step == self.IMAGE_GENERATING:
@@ -563,6 +561,16 @@  class Builder(gtk.Window):
         self.handler.build_failed_async()
         self.stopping = False
 
+    def handler_build_succeeded_cb(self, running_build):
+        if not self.stopping:
+            self.build_succeeded()
+        else:
+            self.build_failed()
+
+
+    def handler_build_failed_cb(self, running_build):
+        self.build_failed()
+
     def handler_task_started_cb(self, running_build, message): 
         fraction = message["current"] * 1.0/message["total"]
         title = "Build packages"