Hob preference fixes
cover Hob preference fixes
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(-)
Signature · 1 line
1.7.6
PATCH 1/2 hob: more reliable disabling of GPLv3 packages
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]
--- 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(-)
lib/bb/ui/crumbs/configurator.py +14 -3
@@ -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 = {}
lib/bb/ui/crumbs/hobeventhandler.py +2 -8
@@ -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:
lib/bb/ui/crumbs/hobprefs.py +18 -6
@@ -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)
lib/bb/ui/hob.py +7 -1
@@ -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)
Signature · 1 line
1.7.6
PATCH 2/2 hob: fix save/restore of toolchain preferences
In reply to Joshua LockAdd some (namespaced) custom variables to the configuration file for sake of this UI.
--- 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(-)
lib/bb/ui/crumbs/configurator.py +8 -0
@@ -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):
lib/bb/ui/crumbs/hobprefs.py +13 -1
@@ -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)
lib/bb/ui/hob.py +4 -1
@@ -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)
Signature · 1 line
1.7.6
Richard Purdie
AppliedQuoted 14 lines · Joshua Lock
Fixes some Yocto bugs reported agains the preferences window.
The following changes since commit
eea5ff9f34bb9b2e29f5fa43deb80d4aa6ef7ddc:bitbake/providers: list
PREFERRED_VERSIONcandidates when unavailable (2011-07-27 16:53:47 +0100)are available in the git repository at:
git://github.com/incandescant/bitbakehob
https://github.com/incandescant/bitbake/tree/hobJoshua Lock (2):
hob: more reliable disabling of GPLv3 packages
hob: fix save/restore of toolchain preferences
Quoted 5 lines
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
Quoted 21 lines · Richard Purdie
Quoted 14 lines · Joshua Lock
Fixes some Yocto bugs reported agains the preferences window.
The following changes since commit
eea5ff9f34bb9b2e29f5fa43deb80d4aa6ef7ddc:bitbake/providers: list
PREFERRED_VERSIONcandidates when unavailable (2011-07-27 16:53:47 +0100)are available in the git repository at:
git://github.com/incandescant/bitbakehob
https://github.com/incandescant/bitbake/tree/hobJoshua Lock (2):
hob: more reliable disabling of GPLv3 packages
hob: fix save/restore of toolchain preferencesQuoted 5 lines
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(-)
Quoted 4 lines
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
Signature · 3 lines
Joshua Lock
Yocto Project "Johannes Factotum"
Intel Open Source Technology Centre