All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Hob preference fixes
@ 2011-07-28 18:10 Joshua Lock
  2011-07-28 18:10 ` [PATCH 1/2] hob: more reliable disabling of GPLv3 packages Joshua Lock
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Joshua Lock @ 2011-07-28 18:10 UTC (permalink / raw)
  To: bitbake-devel

Fixes some Yocto bugs reported agains the preferences window.

The following changes since commit eea5ff9f34bb9b2e29f5fa43deb80d4aa6ef7ddc:

  bitbake/providers: list PREFERRED_VERSION candidates when unavailable (2011-07-27 16:53:47 +0100)

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

Joshua Lock (2):
  hob: more reliable disabling of GPLv3 packages
  hob: fix save/restore of toolchain preferences

 lib/bb/ui/crumbs/configurator.py    |   25 +++++++++++++++++++++--
 lib/bb/ui/crumbs/hobeventhandler.py |   10 +-------
 lib/bb/ui/crumbs/hobprefs.py        |   36 +++++++++++++++++++++++++++++-----
 lib/bb/ui/hob.py                    |   11 +++++++++-
 4 files changed, 64 insertions(+), 18 deletions(-)

-- 
1.7.6




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

* [PATCH 1/2] hob: more reliable disabling of GPLv3 packages
  2011-07-28 18:10 [PATCH 0/2] Hob preference fixes Joshua Lock
@ 2011-07-28 18:10 ` Joshua Lock
  2011-07-28 18:10 ` [PATCH 2/2] hob: fix save/restore of toolchain preferences Joshua Lock
  2011-08-01 15:46 ` [PATCH 0/2] Hob preference fixes Richard Purdie
  2 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2011-07-28 18:10 UTC (permalink / raw)
  To: bitbake-devel

1. reflect GPLv3's presence in INCOMPATIBLE_LICENSE value in the UI

The hob UI currently only supports GPLv3 as a value for
INCOMPATIBLE_LICENSE but doesn't properly reflect whether the value is
already set. This patch rectifies this.

2. don't stomp over other INCOMPATIBLE_LICENSE values when disabling GPLv3

In case the user has other values set for INCOMPATIBLE_LICENSE we don't
want to overwrite the value, we want to modify it.

Fixes [#1286]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/configurator.py    |   17 ++++++++++++++---
 lib/bb/ui/crumbs/hobeventhandler.py |   10 ++--------
 lib/bb/ui/crumbs/hobprefs.py        |   24 ++++++++++++++++++------
 lib/bb/ui/hob.py                    |    8 +++++++-
 4 files changed, 41 insertions(+), 18 deletions(-)

diff --git a/lib/bb/ui/crumbs/configurator.py b/lib/bb/ui/crumbs/configurator.py
index ec48a4f..587a6ff 100644
--- a/lib/bb/ui/crumbs/configurator.py
+++ b/lib/bb/ui/crumbs/configurator.py
@@ -84,9 +84,6 @@ class Configurator(gobject.GObject):
         pmake = getString('PARALLEL_MAKE')
         if pmake and pmake != self.config.get('PARALLEL_MAKE', ''):
             self.config['PARALLEL_MAKE'] = pmake
-        incompat = getString('INCOMPATIBLE_LICENSE')
-        if incompat and incompat != self.config.get('INCOMPATIBLE_LICENSE', ''):
-            self.config['INCOMPATIBLE_LICENSE'] = incompat
         pclass = getString('PACKAGE_CLASSES')
         if pclass and pclass != self.config.get('PACKAGE_CLASSES', ''):
             self.config['PACKAGE_CLASSES'] = pclass
@@ -94,11 +91,25 @@ class Configurator(gobject.GObject):
         if fstypes and fstypes != self.config.get('IMAGE_FSTYPES', ''):
             self.config['IMAGE_FSTYPES'] = fstypes
 
+        # Values which aren't always set in the conf must be explicitly
+        # loaded as empty values for save to work
+        incompat = getString('INCOMPATIBLE_LICENSE')
+        if incompat and incompat != self.config.get('INCOMPATIBLE_LICENSE', ''):
+            self.config['INCOMPATIBLE_LICENSE'] = incompat
+        else:
+            self.config['INCOMPATIBLE_LICENSE'] = ""
+
         self.orig_config = copy.deepcopy(self.config)
 
     def setLocalConfVar(self, var, val):
         self.config[var] = val
 
+    def getLocalConfVar(self, var):
+        if var in self.config:
+            return self.config[var]
+        else:
+            return ""
+
     def _loadLayerConf(self, path):
         self.bblayers = path
         self.enabled_layers = {}
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index 4897bcc..c6ac7d5 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -65,7 +65,6 @@ class HobHandler(gobject.GObject):
 
         self.current_command = None
         self.building = None
-        self.gplv3_excluded = False
         self.build_toolchain = False
         self.build_toolchain_headers = False
         self.generating = False
@@ -269,13 +268,8 @@ class HobHandler(gobject.GObject):
             # leave the workdir in a usable state
             self.server.runCommand(["stateShutdown"])
 
-    def toggle_gplv3(self, excluded):
-        if self.gplv3_excluded != excluded:
-            self.gplv3_excluded = excluded
-            if excluded:
-                self.server.runCommand(["setVariable", "INCOMPATIBLE_LICENSE", "GPLv3"])
-            else:
-                self.server.runCommand(["setVariable", "INCOMPATIBLE_LICENSE", ""])
+    def set_incompatible_license(self, incompatible):
+        self.server.runCommand(["setVariable", "INCOMPATIBLE_LICENSE", incompatible])
 
     def toggle_toolchain(self, enabled):
         if self.build_toolchain != enabled:
diff --git a/lib/bb/ui/crumbs/hobprefs.py b/lib/bb/ui/crumbs/hobprefs.py
index 0f9bda2..be094e7 100644
--- a/lib/bb/ui/crumbs/hobprefs.py
+++ b/lib/bb/ui/crumbs/hobprefs.py
@@ -113,12 +113,20 @@ class HobPrefs(gtk.Dialog):
     
     def include_gplv3_cb(self, toggle):
         excluded = toggle.get_active()
-        self.handler.toggle_gplv3(excluded)
+        orig_incompatible = self.configurator.getLocalConfVar('INCOMPATIBLE_LICENSE')
+        new_incompatible = ""
         if excluded:
-            self.configurator.setLocalConfVar('INCOMPATIBLE_LICENSE', 'GPLv3')
+            if not orig_incompatible:
+                new_incompatible = "GPLv3"
+            elif not orig_incompatible.find('GPLv3'):
+                new_incompatible = "%s GPLv3" % orig_incompatible
         else:
-            self.configurator.setLocalConfVar('INCOMPATIBLE_LICENSE', '')
-        self.reload_required = True
+            new_incompatible = orig_incompatible.replace('GPLv3', '')
+
+        if new_incompatible != orig_incompatible:
+            self.handler.set_incompatible_license(new_incompatible)
+            self.configurator.setLocalConfVar('INCOMPATIBLE_LICENSE', new_incompatible)
+            self.reload_required = True
 
     def change_bb_threads_cb(self, spinner):
         val = spinner.get_value_as_int()
@@ -149,7 +157,8 @@ class HobPrefs(gtk.Dialog):
             glib.idle_add(self.handler.reload_data)
 
     def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass,
-                 cpu_cnt, pmake, bbthread, selected_image_types, all_image_types):
+                 cpu_cnt, pmake, bbthread, selected_image_types, all_image_types,
+                 gplv3disabled):
         """
         """
         gtk.Dialog.__init__(self, "Preferences", None,
@@ -170,11 +179,13 @@ class HobPrefs(gtk.Dialog):
         self.cpu_cnt = cpu_cnt
         self.pmake = pmake
         self.bbthread = bbthread
+        self.selected_image_types = selected_image_types.split(" ")
+        self.gplv3disabled = gplv3disabled
+
         self.reload_required = False
         self.distro_handler_id = None
         self.sdk_machine_handler_id = None
         self.package_handler_id = None
-        self.selected_image_types = selected_image_types.split(" ")
 
         left = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
         right = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
@@ -205,6 +216,7 @@ class HobPrefs(gtk.Dialog):
         check = gtk.CheckButton("Exclude GPLv3 packages")
         check.set_tooltip_text("Check this box to prevent GPLv3 packages from being included in your image")
         check.show()
+        check.set_active(self.gplv3disabled)
         check.connect("toggled", self.include_gplv3_cb)
         hbox.pack_start(check, expand=False, fill=False, padding=6)
         hbox = gtk.HBox(False, 12)
diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index 90d5c5a..a5a2960 100644
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -932,8 +932,14 @@ def main (server, eventHandler):
     # PACKAGE_CLASSES and that's the package manager used for the rootfs
     pkg, sep, pclass = pclasses[0].rpartition("_")
 
+    incompatible = server.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"])
+    gplv3disabled = False
+    if incompatible and incompatible.lower().find("gplv3"):
+        gplv3disabled = True
+
     prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt,
-                     pmake, bbthread, selected_image_types, all_image_types)
+                     pmake, bbthread, selected_image_types, all_image_types,
+                     gplv3disabled)
     layers = LayerEditor(configurator, None)
     window = MainWindow(taskmodel, handler, configurator, prefs, layers, mach)
     prefs.set_parent_window(window)
-- 
1.7.6




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

* [PATCH 2/2] hob: fix save/restore of toolchain preferences
  2011-07-28 18:10 [PATCH 0/2] Hob preference fixes Joshua Lock
  2011-07-28 18:10 ` [PATCH 1/2] hob: more reliable disabling of GPLv3 packages Joshua Lock
@ 2011-07-28 18:10 ` Joshua Lock
  2011-08-01 15:46 ` [PATCH 0/2] Hob preference fixes Richard Purdie
  2 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2011-07-28 18:10 UTC (permalink / raw)
  To: bitbake-devel

Add some (namespaced) custom variables to the configuration file for sake
of this UI.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/configurator.py |    8 ++++++++
 lib/bb/ui/crumbs/hobprefs.py     |   14 +++++++++++++-
 lib/bb/ui/hob.py                 |    5 ++++-
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/crumbs/configurator.py b/lib/bb/ui/crumbs/configurator.py
index 587a6ff..e558c95 100644
--- a/lib/bb/ui/crumbs/configurator.py
+++ b/lib/bb/ui/crumbs/configurator.py
@@ -99,6 +99,14 @@ class Configurator(gobject.GObject):
         else:
             self.config['INCOMPATIBLE_LICENSE'] = ""
 
+        # Non-standard, namespaces, variables for GUI preferences
+        toolchain = getString('HOB_BUILD_TOOLCHAIN')
+        if toolchain and toolchain != self.config.get('HOB_BUILD_TOOLCHAIN', ''):
+            self.config['HOB_BUILD_TOOLCHAIN'] = toolchain
+        header = getString('HOB_BUILD_TOOLCHAIN_HEADERS')
+        if header and header != self.config.get('HOB_BUILD_TOOLCHAIN_HEADERS', ''):
+            self.config['HOB_BUILD_TOOLCHAIN_HEADERS'] = header
+
         self.orig_config = copy.deepcopy(self.config)
 
     def setLocalConfVar(self, var, val):
diff --git a/lib/bb/ui/crumbs/hobprefs.py b/lib/bb/ui/crumbs/hobprefs.py
index be094e7..8ebfba2 100644
--- a/lib/bb/ui/crumbs/hobprefs.py
+++ b/lib/bb/ui/crumbs/hobprefs.py
@@ -140,11 +140,19 @@ class HobPrefs(gtk.Dialog):
 
     def toggle_toolchain_cb(self, check):
         enabled = check.get_active()
+        toolchain = '0'
+        if enabled:
+            toolchain = '1'
         self.handler.toggle_toolchain(enabled)
+        self.configurator.setLocalConfVar('HOB_BUILD_TOOLCHAIN', toolchain)
 
     def toggle_headers_cb(self, check):
         enabled = check.get_active()
+        headers = '0'
+        if enabled:
+            headers = '1'
         self.handler.toggle_toolchain_headers(enabled)
+        self.configurator.setLocalConfVar('HOB_BUILD_TOOLCHAIN_HEADERS', headers)
 
     def set_parent_window(self, parent):
         self.set_transient_for(parent)
@@ -158,7 +166,7 @@ class HobPrefs(gtk.Dialog):
 
     def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass,
                  cpu_cnt, pmake, bbthread, selected_image_types, all_image_types,
-                 gplv3disabled):
+                 gplv3disabled, build_toolchain, build_toolchain_headers):
         """
         """
         gtk.Dialog.__init__(self, "Preferences", None,
@@ -181,6 +189,8 @@ class HobPrefs(gtk.Dialog):
         self.bbthread = bbthread
         self.selected_image_types = selected_image_types.split(" ")
         self.gplv3disabled = gplv3disabled
+        self.build_toolchain = build_toolchain
+        self.build_toolchain_headers = build_toolchain_headers
 
         self.reload_required = False
         self.distro_handler_id = None
@@ -304,6 +314,7 @@ class HobPrefs(gtk.Dialog):
         pbox.pack_start(hbox, expand=False, fill=False, padding=6)
         toolcheck = gtk.CheckButton("Build external development toolchain with image")
         toolcheck.show()
+        toolcheck.set_active(self.build_toolchain)
         toolcheck.connect("toggled", self.toggle_toolchain_cb)
         hbox.pack_start(toolcheck, expand=False, fill=False, padding=6)
         hbox = gtk.HBox(False, 12)
@@ -318,6 +329,7 @@ class HobPrefs(gtk.Dialog):
         hbox.pack_start(self.sdk_machine_combo, expand=False, fill=False, padding=6)
         headerscheck = gtk.CheckButton("Include development headers with toolchain")
         headerscheck.show()
+        headerscheck.set_active(self.build_toolchain_headers)
         headerscheck.connect("toggled", self.toggle_headers_cb)
         hbox.pack_start(headerscheck, expand=False, fill=False, padding=6)
         self.connect("response", self.prefs_response_cb)
diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index a5a2960..305559f 100644
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -937,9 +937,12 @@ def main (server, eventHandler):
     if incompatible and incompatible.lower().find("gplv3"):
         gplv3disabled = True
 
+    build_toolchain = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN"]))
+    build_headers = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN_HEADERS"]))
+
     prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt,
                      pmake, bbthread, selected_image_types, all_image_types,
-                     gplv3disabled)
+                     gplv3disabled, build_toolchain, build_headers)
     layers = LayerEditor(configurator, None)
     window = MainWindow(taskmodel, handler, configurator, prefs, layers, mach)
     prefs.set_parent_window(window)
-- 
1.7.6




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

* Re: [PATCH 0/2] Hob preference fixes
  2011-07-28 18:10 [PATCH 0/2] Hob preference fixes Joshua Lock
  2011-07-28 18:10 ` [PATCH 1/2] hob: more reliable disabling of GPLv3 packages Joshua Lock
  2011-07-28 18:10 ` [PATCH 2/2] hob: fix save/restore of toolchain preferences Joshua Lock
@ 2011-08-01 15:46 ` Richard Purdie
  2011-08-01 16:16   ` Joshua Lock
  2 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2011-08-01 15:46 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel

On Thu, 2011-07-28 at 11:10 -0700, Joshua Lock wrote:
> Fixes some Yocto bugs reported agains the preferences window.
> 
> The following changes since commit eea5ff9f34bb9b2e29f5fa43deb80d4aa6ef7ddc:
> 
>   bitbake/providers: list PREFERRED_VERSION candidates when unavailable (2011-07-27 16:53:47 +0100)
> 
> are available in the git repository at:
>   git://github.com/incandescant/bitbake hob
>   https://github.com/incandescant/bitbake/tree/hob
> 
> Joshua Lock (2):
>   hob: more reliable disabling of GPLv3 packages
>   hob: fix save/restore of toolchain preferences
> 
>  lib/bb/ui/crumbs/configurator.py    |   25 +++++++++++++++++++++--
>  lib/bb/ui/crumbs/hobeventhandler.py |   10 +-------
>  lib/bb/ui/crumbs/hobprefs.py        |   36 +++++++++++++++++++++++++++++-----
>  lib/bb/ui/hob.py                    |   11 +++++++++-
>  4 files changed, 64 insertions(+), 18 deletions(-)

Merged to master, thanks.

I did notice a load of other commits on this branch. Since they weren't
mentioned in the pull request I didn't take them though.

Cheers,

Richard




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

* Re: [PATCH 0/2] Hob preference fixes
  2011-08-01 15:46 ` [PATCH 0/2] Hob preference fixes Richard Purdie
@ 2011-08-01 16:16   ` Joshua Lock
  0 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2011-08-01 16:16 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

On Mon, 2011-08-01 at 16:46 +0100, Richard Purdie wrote:
> On Thu, 2011-07-28 at 11:10 -0700, Joshua Lock wrote:
> > Fixes some Yocto bugs reported agains the preferences window.
> > 
> > The following changes since commit eea5ff9f34bb9b2e29f5fa43deb80d4aa6ef7ddc:
> > 
> >   bitbake/providers: list PREFERRED_VERSION candidates when unavailable (2011-07-27 16:53:47 +0100)
> > 
> > are available in the git repository at:
> >   git://github.com/incandescant/bitbake hob
> >   https://github.com/incandescant/bitbake/tree/hob
> > 
> > Joshua Lock (2):
> >   hob: more reliable disabling of GPLv3 packages
> >   hob: fix save/restore of toolchain preferences
> > 
> >  lib/bb/ui/crumbs/configurator.py    |   25 +++++++++++++++++++++--
> >  lib/bb/ui/crumbs/hobeventhandler.py |   10 +-------
> >  lib/bb/ui/crumbs/hobprefs.py        |   36 +++++++++++++++++++++++++++++-----
> >  lib/bb/ui/hob.py                    |   11 +++++++++-
> >  4 files changed, 64 insertions(+), 18 deletions(-)
> 
> Merged to master, thanks.
> 
> I did notice a load of other commits on this branch. Since they weren't
> mentioned in the pull request I didn't take them though.

Thanks. I forgot I was branch recycling... There's a new pull request
due shortly.

Joshua
-- 
Joshua Lock
        Yocto Project "Johannes Factotum"
        Intel Open Source Technology Centre




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

end of thread, other threads:[~2011-08-01 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-28 18:10 [PATCH 0/2] Hob preference fixes Joshua Lock
2011-07-28 18:10 ` [PATCH 1/2] hob: more reliable disabling of GPLv3 packages Joshua Lock
2011-07-28 18:10 ` [PATCH 2/2] hob: fix save/restore of toolchain preferences Joshua Lock
2011-08-01 15:46 ` [PATCH 0/2] Hob preference fixes Richard Purdie
2011-08-01 16:16   ` Joshua Lock

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.