All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Hob fixes
@ 2011-09-21  1:13 Joshua Lock
  2011-09-21 13:06 ` Richard Purdie
  0 siblings, 1 reply; 8+ messages in thread
From: Joshua Lock @ 2011-09-21  1:13 UTC (permalink / raw)
  To: bitbake-devel

The first patch is another case of my submitting patches with a dumb typo in,
apologies folks, it re-enables the right-click menu for the log messages of
failed tasks.

The second patch fixes the consistency and the URI of the 'Browse folder of
built images" label.

Richard, please consider these for Yocto 1.1 as well as master.

Regards,
Joshua

The following changes since commit 705156e2812afb288632f01416fcbbf9add26bee:

  hob: enable package only builds even if an image has been built (2011-09-19 15:28:09 -0700)

are available in the git repository at:
  git://github.com/incandescant/bitbake hob
  https://github.com/incandescant/bitbake/tree/hob

Joshua Lock (2):
  ui/crumbs/runningbuild: fix log messages right-click menu
  hob: fix opening of image output dir on image build completion

 lib/bb/ui/crumbs/hobeventhandler.py |    5 ++++-
 lib/bb/ui/crumbs/runningbuild.py    |    8 ++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

-- 
1.7.6.2




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] Hob fixes
  2011-09-21  1:13 Joshua Lock
@ 2011-09-21 13:06 ` Richard Purdie
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Purdie @ 2011-09-21 13:06 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel

On Tue, 2011-09-20 at 18:13 -0700, Joshua Lock wrote:
> The first patch is another case of my submitting patches with a dumb typo in,
> apologies folks, it re-enables the right-click menu for the log messages of
> failed tasks.
> 
> The second patch fixes the consistency and the URI of the 'Browse folder of
> built images" label.
> 
> Richard, please consider these for Yocto 1.1 as well as master.
> 
> Regards,
> Joshua
> 
> The following changes since commit 705156e2812afb288632f01416fcbbf9add26bee:
> 
>   hob: enable package only builds even if an image has been built (2011-09-19 15:28:09 -0700)
> 
> are available in the git repository at:
>   git://github.com/incandescant/bitbake hob
>   https://github.com/incandescant/bitbake/tree/hob
> 
> Joshua Lock (2):
>   ui/crumbs/runningbuild: fix log messages right-click menu
>   hob: fix opening of image output dir on image build completion

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Hob fixes
@ 2012-03-26 14:33 Shane Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Shane Wang @ 2012-03-26 14:33 UTC (permalink / raw)
  To: bitbake-devel

These are some fixes for Hob.

The following changes since commit db529f9f7d9015656c67c548975d918a1908de1a:

  documentation/poky-ref-manual/development.xml: another env var clarification (2012-03-26 12:13:49 +0100)

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

Shane Wang (2):
  Hob: Set one of deployable images or runnable images as the default
    toggled item
  Hob: show (package, task) pair which is being executed on the build
    details screen

 bitbake/lib/bb/ui/crumbs/builddetailspage.py |   23 ++++++---
 bitbake/lib/bb/ui/crumbs/builder.py          |   12 +++-
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py |   72 ++++++++++++++++---------
 bitbake/lib/bb/ui/crumbs/runningbuild.py     |    7 +++
 4 files changed, 78 insertions(+), 36 deletions(-)

-- 
1.7.6




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Hob fixes
@ 2012-04-12 14:19 Shane Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Shane Wang @ 2012-04-12 14:19 UTC (permalink / raw)
  To: bitbake-devel

The two patche are going to fix:
 - Hob can not be launched because a function is missing when being merged.
 - Walkaround for exit Hob issue when Hob is parsing recipes.

The following changes since commit 58d2ff3955f5ab8712516651ad6cc51d86bc1ba1:

  package_rpm.bbclass: Use the correct macros file to avoid empty solvedb path issues (2012-04-12 08:22:00 +0100)

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

Shane Wang (2):
  Hob: fix the missing functions
  Hob: forbid users to exit Hob directly when Hob is busy

 bitbake/lib/bb/ui/crumbs/builder.py              |    6 ++++++
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

-- 
1.7.6




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Hob fixes
@ 2012-04-14 18:58 Shane Wang
  2012-04-14 18:58 ` [PATCH 1/2] Hob: remember layers and settings between Hob sessions Shane Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Shane Wang @ 2012-04-14 18:58 UTC (permalink / raw)
  To: bitbake-devel

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(-)

-- 
1.7.6




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] Hob: remember layers and settings between Hob sessions
  2012-04-14 18:58 [PATCH 0/2] Hob fixes Shane Wang
@ 2012-04-14 18:58 ` Shane Wang
  2012-04-14 18:58 ` [PATCH 2/2] Hob: reset user recipe selection and package selection after settings are changed Shane Wang
  2012-04-14 22:59 ` [PATCH 0/2] Hob fixes Richard Purdie
  2 siblings, 0 replies; 8+ messages in thread
From: Shane Wang @ 2012-04-14 18:58 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 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(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index 23aaacd..6d8b509 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -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)
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index de9685d..5dd2b13 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -42,28 +42,23 @@ import bb.ui.crumbs.utils
 class Configuration:
     '''Represents the data structure of configuration.'''
 
-    def __init__(self, params):
-        # Settings
+    def __init__(self):
         self.curr_mach = ""
-        self.curr_distro = params["distro"]
-        self.dldir = params["dldir"]
-        self.sstatedir = params["sstatedir"]
-        self.sstatemirror = params["sstatemirror"]
-        self.pmake = int(params["pmake"].split()[1])
-        self.bbthread = params["bbthread"]
-        self.curr_package_format = " ".join(params["pclass"].split("package_")).strip()
-        self.image_rootfs_size = params["image_rootfs_size"]
-        self.image_extra_size = params["image_extra_size"]
-        self.image_overhead_factor = params['image_overhead_factor']
-        self.incompat_license = params["incompat_license"]
-        self.curr_sdk_machine = params["sdk_machine"]
-        self.conf_version = params["conf_version"]
-        self.lconf_version = params["lconf_version"]
+        # settings
+        self.curr_distro = ""
+        self.dldir = self.sstatedir = self.sstatemirror = ""
+        self.pmake = self.bbthread = 0
+        self.curr_package_format = ""
+        self.image_rootfs_size = self.image_extra_size = 0
+        self.image_overhead_factor = 1
+        self.incompat_license = ""
+        self.curr_sdk_machine = ""
+        self.conf_version = self.lconf_version = ""
         self.extra_setting = {}
         self.toolchain_build = False
-        self.image_fstypes = params["image_fstypes"]
+        self.image_fstypes = ""
         # bblayers.conf
-        self.layers = params["layer"].split()
+        self.layers = []
         # image/recipes/packages
         self.selected_image = None
         self.selected_recipes = []
@@ -71,19 +66,15 @@ class Configuration:
 
         self.user_selected_packages = []
 
-        self.default_task = params["default_task"]
+        self.default_task = "build"
 
         # proxy settings
-        self.all_proxy = params["all_proxy"]
-        self.http_proxy = params["http_proxy"]
-        self.ftp_proxy = params["ftp_proxy"]
-        self.https_proxy = params["https_proxy"]
-        self.git_proxy_host = params["git_proxy_host"]
-        self.git_proxy_port = params["git_proxy_port"]
-        self.cvs_proxy_host = params["cvs_proxy_host"]
-        self.cvs_proxy_port = params["cvs_proxy_port"]
+        self.all_proxy = self.http_proxy = self.ftp_proxy = self.https_proxy = ""
+        self.git_proxy_host = self.git_proxy_port = ""
+        self.cvs_proxy_host = self.cvs_proxy_port = ""
 
     def update(self, params):
+        # settings
         self.curr_distro = params["distro"]
         self.dldir = params["dldir"]
         self.sstatedir = params["sstatedir"]
@@ -99,16 +90,21 @@ class Configuration:
         self.conf_version = params["conf_version"]
         self.lconf_version = params["lconf_version"]
         self.image_fstypes = params["image_fstypes"]
-        self.tune_arch = params["tune_arch"]
-        self.bb_version = params["bb_version"]
-        self.target_arch = params["target_arch"]
-        self.target_os = params["target_os"]
-        self.distro_version = params["distro_version"]
-        self.tune_pkgarch = params["tune_pkgarch"]
+        # self.extra_setting/self.toolchain_build
         # bblayers.conf
         self.layers = params["layer"].split()
         self.default_task = params["default_task"]
 
+        # proxy settings
+        self.all_proxy = params["all_proxy"]
+        self.http_proxy = params["http_proxy"]
+        self.ftp_proxy = params["ftp_proxy"]
+        self.https_proxy = params["https_proxy"]
+        self.git_proxy_host = params["git_proxy_host"]
+        self.git_proxy_port = params["git_proxy_port"]
+        self.cvs_proxy_host = params["cvs_proxy_host"]
+        self.cvs_proxy_port = params["cvs_proxy_port"]
+
     def load(self, template):
         self.curr_mach = template.getVar("MACHINE")
         self.curr_package_format = " ".join(template.getVar("PACKAGE_CLASSES").split("package_")).strip()
@@ -156,11 +152,12 @@ class Configuration:
         self.cvs_proxy_host = template.getVar("CVS_PROXY_HOST")
         self.cvs_proxy_port = template.getVar("CVS_PROXY_PORT")
 
-    def save(self, template):
+    def save(self, template, defaults=False):
         # bblayers.conf
         template.setVar("BBLAYERS", " ".join(self.layers))
         # local.conf
-        template.setVar("MACHINE", self.curr_mach)
+        if not defaults:
+            template.setVar("MACHINE", self.curr_mach)
         template.setVar("DISTRO", self.curr_distro)
         template.setVar("DL_DIR", self.dldir)
         template.setVar("SSTATE_DIR", self.sstatedir)
@@ -177,10 +174,11 @@ class Configuration:
         template.setVar("EXTRA_SETTING", self.extra_setting)
         template.setVar("TOOLCHAIN_BUILD", self.toolchain_build)
         template.setVar("IMAGE_FSTYPES", self.image_fstypes)
-        # image/recipes/packages
-        template.setVar("__SELECTED_IMAGE__", self.selected_image)
-        template.setVar("DEPENDS", self.selected_recipes)
-        template.setVar("IMAGE_INSTALL", self.user_selected_packages)
+        if not defaults:
+            # image/recipes/packages
+            template.setVar("__SELECTED_IMAGE__", self.selected_image)
+            template.setVar("DEPENDS", self.selected_recipes)
+            template.setVar("IMAGE_INSTALL", self.user_selected_packages)
         # proxy
         template.setVar("all_proxy", self.all_proxy)
         template.setVar("http_proxy", self.http_proxy)
@@ -194,23 +192,47 @@ class Configuration:
 class Parameters:
     '''Represents other variables like available machines, etc.'''
 
-    def __init__(self, params):
+    def __init__(self):
         # Variables
+        self.max_threads = 65535
+        self.core_base = ""
+        self.image_addr = ""
+        self.image_types = []
+        self.runnable_image_types = []
+        self.runnable_machine_patterns = []
+        self.deployable_image_types = []
+        self.tmpdir = ""
+
         self.all_machines = []
         self.all_package_formats = []
         self.all_distros = []
         self.all_sdk_machines = []
-        self.max_threads = params["max_threads"]
         self.all_layers = []
-        self.core_base = params["core_base"]
         self.image_names = []
+        self.enable_proxy = False
+
+        # for build log to show
+        self.bb_version = ""
+        self.target_arch = ""
+        self.target_os = ""
+        self.distro_version = ""
+        self.tune_pkgarch = ""
+
+    def update(self, params):
+        self.max_threads = params["max_threads"]
+        self.core_base = params["core_base"]
         self.image_addr = params["image_addr"]
         self.image_types = params["image_types"].split()
         self.runnable_image_types = params["runnable_image_types"].split()
         self.runnable_machine_patterns = params["runnable_machine_patterns"].split()
         self.deployable_image_types = params["deployable_image_types"].split()
         self.tmpdir = params["tmpdir"]
-        self.enable_proxy = False
+        # for build log to show
+        self.bb_version = params["bb_version"]
+        self.target_arch = params["target_arch"]
+        self.target_os = params["target_os"]
+        self.distro_version = params["distro_version"]
+        self.tune_pkgarch = params["tune_pkgarch"]
 
 def hob_conf_filter(fn, data):
     if fn.endswith("/local.conf"):
@@ -287,6 +309,10 @@ class Builder(gtk.Window):
 
         self.template = None
 
+        # configuration and parameters
+        self.configuration = Configuration()
+        self.parameters = Parameters()
+
         # build step
         self.current_step = None
         self.previous_step = None
@@ -365,9 +391,10 @@ class Builder(gtk.Window):
 
     def initiate_new_build_async(self):
         self.switch_page(self.MACHINE_SELECTION)
-        self.handler.init_cooker()
-        self.handler.set_extra_inherit("image_types")
-        self.handler.parse_config()
+        if self.load_template(TemplateMgr.convert_to_template_pathfilename("default", ".hob/")) == None:
+            self.handler.init_cooker()
+            self.handler.set_extra_inherit("image_types")
+            self.handler.parse_config()
 
     def update_config_async(self):
         self.switch_page(self.MACHINE_SELECTION)
@@ -432,20 +459,25 @@ class Builder(gtk.Window):
         self.handler.cancel_parse()
 
     def load_template(self, path):
+        if not os.path.isfile(path):
+            return None
+
         self.template = TemplateMgr()
         self.template.load(path)
         self.configuration.load(self.template)
 
+        self.template.destroy()
+        self.template = None
+
         for layer in self.configuration.layers:
             if not os.path.exists(layer+'/conf/layer.conf'):
                 return False
 
+        self.save_defaults() # remember layers and settings
         self.update_config_async()
+        return True
 
-        self.template.destroy()
-        self.template = None
-
-    def save_template(self, path):
+    def save_template(self, path, defaults=False):
         if path.rfind("/") == -1:
             filename = "default"
             path = "."
@@ -455,12 +487,17 @@ class Builder(gtk.Window):
 
         self.template = TemplateMgr()
         self.template.open(filename, path)
-        self.configuration.save(self.template)
+        self.configuration.save(self.template, defaults)
 
         self.template.save()
         self.template.destroy()
         self.template = None
 
+    def save_defaults(self):
+        if not os.path.exists(".hob/"):
+            os.mkdir(".hob/")
+        self.save_template(".hob/default", True)
+
     def switch_page(self, next_step):
         # Main Workflow (Business Logic)
         self.nb.set_current_page(self.__step2page__[next_step])
@@ -544,6 +581,11 @@ class Builder(gtk.Window):
         left = self.package_model.set_selected_packages(selected_packages)
         self.configuration.selected_packages += left
 
+    def update_configuration_parameters(self, params):
+        if params:
+            self.configuration.update(params)
+            self.parameters.update(params)
+
     # Callback Functions
     def handler_config_updated_cb(self, handler, which, values):
         if which == "distro":
@@ -560,19 +602,15 @@ class Builder(gtk.Window):
     def handler_command_succeeded_cb(self, handler, initcmd):
         if initcmd == self.handler.PARSE_CONFIG:
             # settings
-            params = self.get_parameters_sync()
-            self.configuration = Configuration(params)
-            self.parameters = Parameters(params)
+            self.update_configuration_parameters(self.get_parameters_sync())
             self.generate_configuration_async()
         elif initcmd == self.handler.GENERATE_CONFIGURATION:
-            params = self.get_parameters_sync()
-            self.configuration.update(params)
+            self.update_configuration_parameters(self.get_parameters_sync())
             self.image_configuration_page.switch_machine_combo()
         elif initcmd in [self.handler.GENERATE_RECIPES,
                          self.handler.GENERATE_PACKAGES,
                          self.handler.GENERATE_IMAGE]:
-            params = self.get_parameters_sync()
-            self.configuration.update(params)
+            self.update_configuration_parameters(self.get_parameters_sync())
             self.request_package_info_async()
         elif initcmd == self.handler.POPULATE_PACKAGEINFO:
             if self.current_step == self.RCPPKGINFO_POPULATING:
@@ -691,7 +729,7 @@ class Builder(gtk.Window):
         elif self.current_step == self.PACKAGE_GENERATING:
             fraction = 0
         self.build_details_page.update_progress_bar("Build Started: ", fraction)
-        self.build_details_page.show_configurations(self.configuration)
+        self.build_details_page.show_configurations(self.configuration, self.parameters)
 
     def build_succeeded(self):
         if self.current_step == self.FAST_IMAGE_GENERATING:
@@ -857,6 +895,7 @@ class Builder(gtk.Window):
         response = dialog.run()
         if response == gtk.RESPONSE_YES:
             self.configuration.layers = dialog.layers
+            self.save_defaults() # remember layers
             # DO refresh layers
             if dialog.layers_changed:
                 self.update_config_async()
@@ -943,6 +982,7 @@ class Builder(gtk.Window):
         if response == gtk.RESPONSE_YES:
             self.parameters.enable_proxy = dialog.enable_proxy
             self.configuration = dialog.configuration
+            self.save_defaults() # remember settings
             settings_changed = dialog.settings_changed
         dialog.destroy()
         return response == gtk.RESPONSE_YES, settings_changed
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 17d3fe4..7a3cc6b 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -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"
 
diff --git a/bitbake/lib/bb/ui/crumbs/template.py b/bitbake/lib/bb/ui/crumbs/template.py
index 5679c18..cbed270 100644
--- a/bitbake/lib/bb/ui/crumbs/template.py
+++ b/bitbake/lib/bb/ui/crumbs/template.py
@@ -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__:
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] Hob: reset user recipe selection and package selection after settings are changed
  2012-04-14 18:58 [PATCH 0/2] Hob fixes Shane Wang
  2012-04-14 18:58 ` [PATCH 1/2] Hob: remember layers and settings between Hob sessions Shane Wang
@ 2012-04-14 18:58 ` Shane Wang
  2012-04-14 22:59 ` [PATCH 0/2] Hob fixes Richard Purdie
  2 siblings, 0 replies; 8+ messages in thread
From: Shane Wang @ 2012-04-14 18:58 UTC (permalink / raw)
  To: bitbake-devel

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]

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py                |   12 ++++++++----
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    4 +---
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 5dd2b13..48053b3 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -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):
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index 64c512d5..0463ee8 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -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
 
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] Hob fixes
  2012-04-14 18:58 [PATCH 0/2] Hob fixes Shane Wang
  2012-04-14 18:58 ` [PATCH 1/2] Hob: remember layers and settings between Hob sessions Shane Wang
  2012-04-14 18:58 ` [PATCH 2/2] Hob: reset user recipe selection and package selection after settings are changed Shane Wang
@ 2012-04-14 22:59 ` Richard Purdie
  2 siblings, 0 replies; 8+ messages in thread
From: Richard Purdie @ 2012-04-14 22:59 UTC (permalink / raw)
  To: Shane Wang; +Cc: bitbake-devel

On Sun, 2012-04-15 at 02:58 +0800, Shane Wang wrote:
> 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(-)

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-04-14 23:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-14 18:58 [PATCH 0/2] Hob fixes Shane Wang
2012-04-14 18:58 ` [PATCH 1/2] Hob: remember layers and settings between Hob sessions Shane Wang
2012-04-14 18:58 ` [PATCH 2/2] Hob: reset user recipe selection and package selection after settings are changed Shane Wang
2012-04-14 22:59 ` [PATCH 0/2] Hob fixes Richard Purdie
  -- strict thread matches above, loose matches on Subject: below --
2012-04-12 14:19 Shane Wang
2012-03-26 14:33 Shane Wang
2011-09-21  1:13 Joshua Lock
2011-09-21 13:06 ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.