Patchwork [bitbake-devel,10/20] Hob: clean up and unify the steps for IMAGE_GENERATING to call generate_image_async()

login
register
mail settings
Submitter Shane Wang
Date April 8, 2012, 10:21 a.m.
Message ID <b07f24ba2fde9906cef4f5a946c9eeab03da79cf.1333880210.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/25315/
State New
Headers show

Comments

Shane Wang - April 8, 2012, 10:21 a.m.
For the steps in IMAGE_GENERATING, the patch consolidates them into
generate_image_async() to call.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 8a95b94..959d8c1 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -361,6 +361,20 @@  class Builder(gtk.Window):
         self.handler.reset_build()
         self.handler.generate_packages(all_recipes)
 
+    def generate_image_async(self):
+        self.switch_page(self.IMAGE_GENERATING)
+        # Build image
+        self.set_user_config()
+        packages = self.package_model.get_selected_packages()
+        toolchain_packages = []
+        if self.configuration.toolchain_build:
+            toolchain_packages = self.package_model.get_selected_packages_toolchain()
+        self.handler.reset_build()
+        self.handler.generate_image(packages,
+                                    self.hob_image,
+                                    self.hob_toolchain,
+                                    toolchain_packages)
+
     def load_template(self, path):
         self.template = TemplateMgr()
         self.template.load(path)
@@ -426,7 +440,6 @@  class Builder(gtk.Window):
             # after packages are generated, selected_packages need to
             # be updated in package_model per selected_image in recipe_model
             self.build_details_page.show_page(next_step)
-            self.generate_image()
 
         elif next_step == self.IMAGE_GENERATED:
             self.image_details_page.show_page(next_step)
@@ -475,19 +488,6 @@  class Builder(gtk.Window):
         left = self.package_model.set_selected_packages(selected_packages)
         self.configuration.selected_packages += left
 
-    def generate_image(self):
-        # Build image
-        self.set_user_config()
-        packages = self.package_model.get_selected_packages()
-        toolchain_packages = []
-        if self.configuration.toolchain_build:
-            toolchain_packages = self.package_model.get_selected_packages_toolchain()
-        self.handler.reset_build()
-        self.handler.generate_image(packages,
-                                    self.hob_image,
-                                    self.hob_toolchain,
-                                    toolchain_packages)
-
     # Callback Functions
     def handler_config_updated_cb(self, handler, which, values):
         if which == "distro":
@@ -526,7 +526,7 @@  class Builder(gtk.Window):
 
             self.rcppkglist_populated()
             if self.current_step == self.FAST_IMAGE_GENERATING:
-                self.switch_page(self.IMAGE_GENERATING)
+                self.generate_image_async()
             elif self.current_step == self.PACKAGE_GENERATING:
                 self.switch_page(self.PACKAGE_GENERATED)
             elif self.current_step == self.IMAGE_GENERATING:
@@ -758,7 +758,7 @@  class Builder(gtk.Window):
             dialog.run()
             dialog.destroy()
             return
-        self.switch_page(self.IMAGE_GENERATING)
+        self.generate_image_async()
 
     def just_bake(self):
         selected_image = self.recipe_model.get_selected_image()