Skip to contentSkip to conversation

Hob fixes

PATCH Applied Shane Wang 2 participants 4 messages Apr 14, 2012

lore
Share & tools
lore

Shane Wang

author
#0 lore raw

cover Hob fixes

The fixes include:
- remember settings and layers between Hob sessions.
- continue to fix another case to forget user selection when settings are changed.

The following changes since commit 276b86509ba29046828d283f15ae44ae0850d1d0:

Hob: Use BB_DEFAULT_TASK as build task instead of hardcoded "build" (2012-04-14 14:43:24 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib shane/hob_0413
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob_0413

Shane Wang (2):
Hob: remember layers and settings between Hob sessions
Hob: reset user recipe selection and package selection after settings
are changed

 bitbake/lib/bb/ui/crumbs/builddetailspage.py       |   16 +-
 bitbake/lib/bb/ui/crumbs/builder.py                |  170 ++++++++++++-------
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py        |    1 -
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    4 +-
 bitbake/lib/bb/ui/crumbs/template.py               |   24 +++-
 5 files changed, 136 insertions(+), 79 deletions(-)
Signature · 1 line
1.7.6
author
#1 lore raw

PATCH 1/2 Hob: remember layers and settings between Hob sessions

This patch is to remember layers and settings between Hob sessions, which includes:
- Put some variables for the build details screen from Configuration to Parameters because they are not actually for build but for show
- We create a dummy Configuration instance and a dummy Parameters instance in __init__ of builder
- The two instances will be assigned the real values by update_configuration_parameters() after parsing (in the event callback)
- When it is the first time to launch Hob in a build directory, nothing is remembered since everything is fresh.
- The feature is implemented with templates, and based on the hook for Hob.
- When the user changes the layers or the settings, a default template file is saved into ".hob/".
- Later on, the layers and the settings are remembered by loading the default template automatically.

---
 bitbake/lib/bb/ui/crumbs/builddetailspage.py |   16 ++--
 bitbake/lib/bb/ui/crumbs/builder.py          |  158 ++++++++++++++++----------
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py  |    1 -
 bitbake/lib/bb/ui/crumbs/template.py         |   24 ++++-
 4 files changed, 127 insertions(+), 72 deletions(-)
bitbake/lib/bb/ui/crumbs/builddetailspage.py +8 -8
index 23aaacd..6d8b509 100755
@@ -81,16 +81,16 @@ class BuildConfigurationTreeView(gtk.TreeView):
         # renew the tree model after get the configuration messages
         self.set_model(listmodel)
 
-    def show(self, src_config_info):
+    def show(self, src_config_info, src_params):
         vars = []
-        vars.append(self.set_vars("BB version:", src_config_info.bb_version))
-        vars.append(self.set_vars("Target arch:", src_config_info.target_arch))
-        vars.append(self.set_vars("Target OS:", src_config_info.target_os))
+        vars.append(self.set_vars("BB version:", src_params.bb_version))
+        vars.append(self.set_vars("Target arch:", src_params.target_arch))
+        vars.append(self.set_vars("Target OS:", src_params.target_os))
         vars.append(self.set_vars("Machine:", src_config_info.curr_mach))
         vars.append(self.set_vars("Distro:", src_config_info.curr_distro))
-        vars.append(self.set_vars("Distro version:", src_config_info.distro_version))
+        vars.append(self.set_vars("Distro version:", src_params.distro_version))
         vars.append(self.set_vars("SDK machine:", src_config_info.curr_sdk_machine))
-        vars.append(self.set_vars("Tune feature:", src_config_info.tune_pkgarch))
+        vars.append(self.set_vars("Tune features:", src_params.tune_pkgarch))
         vars.append(self.set_vars("Layers:", src_config_info.layers))
 
         for path in src_config_info.layers:
@@ -248,5 +248,5 @@ class BuildDetailsPage (HobPage):
                 if (v_adj.upper <= v_adj.page_size) or (v_adj.value == v_adj.upper - v_adj.page_size):
                     treeview.scroll_to_cell(path)
 
-    def show_configurations(self, configurations):
-        self.config_tv.show(configurations)
+    def show_configurations(self, configurations, params):
+        self.config_tv.show(configurations, params)
bitbake/lib/bb/ui/crumbs/builder.py +99 -59

297 lines not on this page · raw message

bitbake/lib/bb/ui/crumbs/hobeventhandler.py +0 -1
index 17d3fe4..7a3cc6b 100644
@@ -495,7 +495,6 @@ class HobHandler(gobject.GObject):
         params["target_arch"] = self.server.runCommand(["getVariable", "TARGET_ARCH"]) or ""
         params["tune_pkgarch"] = self.server.runCommand(["getVariable", "TUNE_PKGARCH"])  or ""
         params["bb_version"] = self.server.runCommand(["getVariable", "BB_MIN_VERSION"]) or ""
-        params["tune_arch"] = self.server.runCommand(["getVariable", "TUNE_ARCH"]) or ""
 
         params["default_task"] = self.server.runCommand(["getVariable", "BB_DEFAULT_TASK"]) or "build"
 
bitbake/lib/bb/ui/crumbs/template.py +20 -4
index 5679c18..cbed270 100644
@@ -136,11 +136,27 @@ class TemplateMgr(gobject.GObject):
         self.local_conf = None
         self.image_bb = None
 
+    @classmethod
+    def convert_to_template_pathfilename(cls, filename, path):
+        return "%s/%s%s%s" % (path, "template-", filename, ".hob")
+
+    @classmethod
+    def convert_to_bblayers_pathfilename(cls, filename, path):
+        return "%s/%s%s%s" % (path, "bblayers-", filename, ".conf")
+
+    @classmethod
+    def convert_to_local_pathfilename(cls, filename, path):
+        return "%s/%s%s%s" % (path, "local-", filename, ".conf")
+
+    @classmethod
+    def convert_to_image_pathfilename(cls, filename, path):
+        return "%s/%s%s%s" % (path, "hob-image-", filename, ".bb")
+
     def open(self, filename, path):
-        self.template_hob = HobTemplateFile("%s/%s%s%s" % (path, "template-", filename, ".hob"))
-        self.bblayers_conf = ConfigFile("%s/%s%s%s" % (path, "bblayers-", filename, ".conf"))
-        self.local_conf = ConfigFile("%s/%s%s%s" % (path, "local-", filename, ".conf"))
-        self.image_bb = RecipeFile("%s/%s%s%s" % (path, "hob-image-", filename, ".bb"))
+        self.template_hob = HobTemplateFile(TemplateMgr.convert_to_template_pathfilename(filename, path))
+        self.bblayers_conf = ConfigFile(TemplateMgr.convert_to_bblayers_pathfilename(filename, path))
+        self.local_conf = ConfigFile(TemplateMgr.convert_to_local_pathfilename(filename, path))
+        self.image_bb = RecipeFile(TemplateMgr.convert_to_image_pathfilename(filename, path))
 
     def setVar(self, var, val):
         if var in TemplateMgr.__gLocalVars__:
Signature · 1 line
1.7.6
author
#2 lore raw

PATCH 2/2 Hob: reset user recipe selection and package selection after settings are changed

Reset user recipe list and package list after the user changes the settings and triggers recipe reparsing.

This is to continue to fix the bug [Yocto #2255]

[Yocto #2255]

---
 bitbake/lib/bb/ui/crumbs/builder.py                |   12 ++++++++----
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    4 +---
 2 files changed, 9 insertions(+), 7 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +8 -4
index 5dd2b13..48053b3 100755
@@ -60,9 +60,7 @@ class Configuration:
         # bblayers.conf
         self.layers = []
         # image/recipes/packages
-        self.selected_image = None
-        self.selected_recipes = []
-        self.selected_packages = []
+        self.clear_selection()
 
         self.user_selected_packages = []
 
@@ -73,6 +71,11 @@ class Configuration:
         self.git_proxy_host = self.git_proxy_port = ""
         self.cvs_proxy_host = self.cvs_proxy_port = ""
 
+    def clear_selection(self):
+        self.selected_image = None
+        self.selected_recipes = []
+        self.selected_packages = []
+
     def update(self, params):
         # settings
         self.curr_distro = params["distro"]
@@ -988,10 +991,11 @@ class Builder(gtk.Window):
         return response == gtk.RESPONSE_YES, settings_changed
 
     def reparse_post_adv_settings(self):
-        # DO reparse recipes
         if not self.configuration.curr_mach:
             self.update_config_async()
         else:
+            self.configuration.clear_selection()
+            # DO reparse recipes
             self.populate_recipe_package_info_async()
 
     def deploy_image(self, image_name):
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +1 -3
index 64c512d5..0463ee8 100644
@@ -264,9 +264,7 @@ class ImageConfigurationPage (HobPage):
 
         self.builder.configuration.curr_mach = combo_item
         if self.machine_combo_changed_by_manual:
-            self.builder.configuration.selected_image = None
-            self.builder.configuration.selected_recipes = []
-            self.builder.configuration.selected_packages = []
+            self.builder.configuration.clear_selection()
         # reset machine_combo_changed_by_manual
         self.machine_combo_changed_by_manual = True
 
Signature · 1 line
1.7.6
#3 lore raw
In reply to Shane Wang
Quoted 17 lines · Shane Wang

The fixes include:
- remember settings and layers between Hob sessions.
- continue to fix another case to forget user selection when settings are changed.

The following changes since commit 276b86509ba29046828d283f15ae44ae0850d1d0:

Hob: Use BB_DEFAULT_TASK as build task instead of hardcoded "build" (2012-04-14 14:43:24 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib shane/hob_0413
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob_0413

Shane Wang (2):
Hob: remember layers and settings between Hob sessions
Hob: reset user recipe selection and package selection after settings
are changed

Quoted 6 lines
 bitbake/lib/bb/ui/crumbs/builddetailspage.py       |   16 +-
 bitbake/lib/bb/ui/crumbs/builder.py                |  170 ++++++++++++-------
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py        |    1 -
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    4 +-
 bitbake/lib/bb/ui/crumbs/template.py               |   24 +++-
 5 files changed, 136 insertions(+), 79 deletions(-)

Merged to master, thanks.

Richard