summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/hobprefs.py
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-27 16:10:39 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-01 16:49:09 +0100
commit42fe3c613153c8abfa9cba4307919a69778fe739 (patch)
tree8266a632fa3120957887418ba2b5c693105f2346 /bitbake/lib/bb/ui/crumbs/hobprefs.py
parenta10fb4f72a3a072baf8d50f5a9c1dff93320a5ed (diff)
downloadpoky-42fe3c613153c8abfa9cba4307919a69778fe739.tar.gz
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] (Bitbake rev: 68b992922bc7148d657a1c706c6acc67812a87c0) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hobprefs.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobprefs.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobprefs.py b/bitbake/lib/bb/ui/crumbs/hobprefs.py
index 0f9bda2a4a..be094e7c93 100644
--- a/bitbake/lib/bb/ui/crumbs/hobprefs.py
+++ b/bitbake/lib/bb/ui/crumbs/hobprefs.py
@@ -113,12 +113,20 @@ class HobPrefs(gtk.Dialog):
113 113
114 def include_gplv3_cb(self, toggle): 114 def include_gplv3_cb(self, toggle):
115 excluded = toggle.get_active() 115 excluded = toggle.get_active()
116 self.handler.toggle_gplv3(excluded) 116 orig_incompatible = self.configurator.getLocalConfVar('INCOMPATIBLE_LICENSE')
117 new_incompatible = ""
117 if excluded: 118 if excluded:
118 self.configurator.setLocalConfVar('INCOMPATIBLE_LICENSE', 'GPLv3') 119 if not orig_incompatible:
120 new_incompatible = "GPLv3"
121 elif not orig_incompatible.find('GPLv3'):
122 new_incompatible = "%s GPLv3" % orig_incompatible
119 else: 123 else:
120 self.configurator.setLocalConfVar('INCOMPATIBLE_LICENSE', '') 124 new_incompatible = orig_incompatible.replace('GPLv3', '')
121 self.reload_required = True 125
126 if new_incompatible != orig_incompatible:
127 self.handler.set_incompatible_license(new_incompatible)
128 self.configurator.setLocalConfVar('INCOMPATIBLE_LICENSE', new_incompatible)
129 self.reload_required = True
122 130
123 def change_bb_threads_cb(self, spinner): 131 def change_bb_threads_cb(self, spinner):
124 val = spinner.get_value_as_int() 132 val = spinner.get_value_as_int()
@@ -149,7 +157,8 @@ class HobPrefs(gtk.Dialog):
149 glib.idle_add(self.handler.reload_data) 157 glib.idle_add(self.handler.reload_data)
150 158
151 def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass, 159 def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass,
152 cpu_cnt, pmake, bbthread, selected_image_types, all_image_types): 160 cpu_cnt, pmake, bbthread, selected_image_types, all_image_types,
161 gplv3disabled):
153 """ 162 """
154 """ 163 """
155 gtk.Dialog.__init__(self, "Preferences", None, 164 gtk.Dialog.__init__(self, "Preferences", None,
@@ -170,11 +179,13 @@ class HobPrefs(gtk.Dialog):
170 self.cpu_cnt = cpu_cnt 179 self.cpu_cnt = cpu_cnt
171 self.pmake = pmake 180 self.pmake = pmake
172 self.bbthread = bbthread 181 self.bbthread = bbthread
182 self.selected_image_types = selected_image_types.split(" ")
183 self.gplv3disabled = gplv3disabled
184
173 self.reload_required = False 185 self.reload_required = False
174 self.distro_handler_id = None 186 self.distro_handler_id = None
175 self.sdk_machine_handler_id = None 187 self.sdk_machine_handler_id = None
176 self.package_handler_id = None 188 self.package_handler_id = None
177 self.selected_image_types = selected_image_types.split(" ")
178 189
179 left = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) 190 left = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
180 right = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) 191 right = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
@@ -205,6 +216,7 @@ class HobPrefs(gtk.Dialog):
205 check = gtk.CheckButton("Exclude GPLv3 packages") 216 check = gtk.CheckButton("Exclude GPLv3 packages")
206 check.set_tooltip_text("Check this box to prevent GPLv3 packages from being included in your image") 217 check.set_tooltip_text("Check this box to prevent GPLv3 packages from being included in your image")
207 check.show() 218 check.show()
219 check.set_active(self.gplv3disabled)
208 check.connect("toggled", self.include_gplv3_cb) 220 check.connect("toggled", self.include_gplv3_cb)
209 hbox.pack_start(check, expand=False, fill=False, padding=6) 221 hbox.pack_start(check, expand=False, fill=False, padding=6)
210 hbox = gtk.HBox(False, 12) 222 hbox = gtk.HBox(False, 12)