summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorShane Wang <shane.wang@intel.com>2012-05-23 23:19:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-23 18:17:02 +0100
commit49694d650c61547d881a782af2a0f24dc39a042f (patch)
tree3850a6d5f7ca9adfbd047bf4da60a03f984fdc45 /bitbake
parent799e076938b49353d1653e90206701069b8edb0b (diff)
downloadpoky-49694d650c61547d881a782af2a0f24dc39a042f.tar.gz
Hob: Adjust the progress bar and set 100% only when all is done.
After parsing recipes, Hob will populate recipes and packages, which is probably time exhaused. So, this patch is to adjust the progress bar and ensure 100% is set if and only if all populations are done. The patch also fixes "weird 18 second delay when parsing recipes" on build appliance. Because Hob is doing something, but the progress bar shows 100% and wait there. [Yocto #2341] (Bitbake rev: 2c4a21dc8a588c8cf05549ddd9734731a46bea10) Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py12
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py8
2 files changed, 18 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 141ee2c560..80a8d0160a 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -424,6 +424,8 @@ class Builder(gtk.Window):
424 self.handler.connect("data-generated", self.handler_data_generated_cb) 424 self.handler.connect("data-generated", self.handler_data_generated_cb)
425 self.handler.connect("command-succeeded", self.handler_command_succeeded_cb) 425 self.handler.connect("command-succeeded", self.handler_command_succeeded_cb)
426 self.handler.connect("command-failed", self.handler_command_failed_cb) 426 self.handler.connect("command-failed", self.handler_command_failed_cb)
427 self.handler.connect("recipe-populated", self.handler_recipe_populated_cb)
428 self.handler.connect("package-populated", self.handler_package_populated_cb)
427 429
428 self.handler.set_config_filter(hob_conf_filter) 430 self.handler.set_config_filter(hob_conf_filter)
429 431
@@ -773,6 +775,12 @@ class Builder(gtk.Window):
773 def packagelist_changed_cb(self, package_model): 775 def packagelist_changed_cb(self, package_model):
774 self.package_details_page.refresh_selection() 776 self.package_details_page.refresh_selection()
775 777
778 def handler_recipe_populated_cb(self, handler):
779 self.image_configuration_page.update_progress_bar("Populated recipes", 0.99)
780
781 def handler_package_populated_cb(self, handler):
782 self.image_configuration_page.update_progress_bar("Populated packages", 1.0)
783
776 def handler_parsing_started_cb(self, handler, message): 784 def handler_parsing_started_cb(self, handler, message):
777 if self.current_step != self.RCPPKGINFO_POPULATING: 785 if self.current_step != self.RCPPKGINFO_POPULATING:
778 return 786 return
@@ -792,7 +800,7 @@ class Builder(gtk.Window):
792 800
793 fraction = message["current"] * 1.0/message["total"] 801 fraction = message["current"] * 1.0/message["total"]
794 if message["eventname"] == "TreeDataPreparationProgress": 802 if message["eventname"] == "TreeDataPreparationProgress":
795 fraction = 0.6 + 0.4 * fraction 803 fraction = 0.6 + 0.38 * fraction
796 else: 804 else:
797 fraction = 0.6 * fraction 805 fraction = 0.6 * fraction
798 self.image_configuration_page.update_progress_bar(message["title"], fraction) 806 self.image_configuration_page.update_progress_bar(message["title"], fraction)
@@ -802,7 +810,7 @@ class Builder(gtk.Window):
802 return 810 return
803 811
804 if message["eventname"] == "TreeDataPreparationCompleted": 812 if message["eventname"] == "TreeDataPreparationCompleted":
805 fraction = 1.0 813 fraction = 0.98
806 else: 814 else:
807 fraction = 0.6 815 fraction = 0.6
808 self.image_configuration_page.update_progress_bar(message["title"], fraction) 816 self.image_configuration_page.update_progress_bar(message["title"], fraction)
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 7303ff8df1..b34bdbefd4 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -57,6 +57,12 @@ class HobHandler(gobject.GObject):
57 "parsing-completed" : (gobject.SIGNAL_RUN_LAST, 57 "parsing-completed" : (gobject.SIGNAL_RUN_LAST,
58 gobject.TYPE_NONE, 58 gobject.TYPE_NONE,
59 (gobject.TYPE_PYOBJECT,)), 59 (gobject.TYPE_PYOBJECT,)),
60 "recipe-populated" : (gobject.SIGNAL_RUN_LAST,
61 gobject.TYPE_NONE,
62 ()),
63 "package-populated" : (gobject.SIGNAL_RUN_LAST,
64 gobject.TYPE_NONE,
65 ()),
60 } 66 }
61 67
62 (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO, SANITY_CHECK) = range(6) 68 (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO, SANITY_CHECK) = range(6)
@@ -158,6 +164,7 @@ class HobHandler(gobject.GObject):
158 164
159 if isinstance(event, bb.event.PackageInfo): 165 if isinstance(event, bb.event.PackageInfo):
160 self.package_model.populate(event._pkginfolist) 166 self.package_model.populate(event._pkginfolist)
167 self.emit("package-populated")
161 self.run_next_command() 168 self.run_next_command()
162 169
163 elif isinstance(event, bb.event.SanityCheckPassed): 170 elif isinstance(event, bb.event.SanityCheckPassed):
@@ -171,6 +178,7 @@ class HobHandler(gobject.GObject):
171 self.current_phase = "data generation" 178 self.current_phase = "data generation"
172 if event._model: 179 if event._model:
173 self.recipe_model.populate(event._model) 180 self.recipe_model.populate(event._model)
181 self.emit("recipe-populated")
174 elif isinstance(event, bb.event.ConfigFilesFound): 182 elif isinstance(event, bb.event.ConfigFilesFound):
175 self.current_phase = "configuration lookup" 183 self.current_phase = "configuration lookup"
176 var = event._variable 184 var = event._variable