summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--bitbake/lib/bb/ui/crumbs/configurator.py17
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py10
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobprefs.py24
-rw-r--r--bitbake/lib/bb/ui/hob.py8
4 files changed, 41 insertions, 18 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/configurator.py b/bitbake/lib/bb/ui/crumbs/configurator.py
index ec48a4f3f0..587a6ff129 100644
--- a/bitbake/lib/bb/ui/crumbs/configurator.py
+++ b/bitbake/lib/bb/ui/crumbs/configurator.py
@@ -84,9 +84,6 @@ class Configurator(gobject.GObject):
84 pmake = getString('PARALLEL_MAKE') 84 pmake = getString('PARALLEL_MAKE')
85 if pmake and pmake != self.config.get('PARALLEL_MAKE', ''): 85 if pmake and pmake != self.config.get('PARALLEL_MAKE', ''):
86 self.config['PARALLEL_MAKE'] = pmake 86 self.config['PARALLEL_MAKE'] = pmake
87 incompat = getString('INCOMPATIBLE_LICENSE')
88 if incompat and incompat != self.config.get('INCOMPATIBLE_LICENSE', ''):
89 self.config['INCOMPATIBLE_LICENSE'] = incompat
90 pclass = getString('PACKAGE_CLASSES') 87 pclass = getString('PACKAGE_CLASSES')
91 if pclass and pclass != self.config.get('PACKAGE_CLASSES', ''): 88 if pclass and pclass != self.config.get('PACKAGE_CLASSES', ''):
92 self.config['PACKAGE_CLASSES'] = pclass 89 self.config['PACKAGE_CLASSES'] = pclass
@@ -94,11 +91,25 @@ class Configurator(gobject.GObject):
94 if fstypes and fstypes != self.config.get('IMAGE_FSTYPES', ''): 91 if fstypes and fstypes != self.config.get('IMAGE_FSTYPES', ''):
95 self.config['IMAGE_FSTYPES'] = fstypes 92 self.config['IMAGE_FSTYPES'] = fstypes
96 93
94 # Values which aren't always set in the conf must be explicitly
95 # loaded as empty values for save to work
96 incompat = getString('INCOMPATIBLE_LICENSE')
97 if incompat and incompat != self.config.get('INCOMPATIBLE_LICENSE', ''):
98 self.config['INCOMPATIBLE_LICENSE'] = incompat
99 else:
100 self.config['INCOMPATIBLE_LICENSE'] = ""
101
97 self.orig_config = copy.deepcopy(self.config) 102 self.orig_config = copy.deepcopy(self.config)
98 103
99 def setLocalConfVar(self, var, val): 104 def setLocalConfVar(self, var, val):
100 self.config[var] = val 105 self.config[var] = val
101 106
107 def getLocalConfVar(self, var):
108 if var in self.config:
109 return self.config[var]
110 else:
111 return ""
112
102 def _loadLayerConf(self, path): 113 def _loadLayerConf(self, path):
103 self.bblayers = path 114 self.bblayers = path
104 self.enabled_layers = {} 115 self.enabled_layers = {}
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 4897bccd26..c6ac7d5499 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -65,7 +65,6 @@ class HobHandler(gobject.GObject):
65 65
66 self.current_command = None 66 self.current_command = None
67 self.building = None 67 self.building = None
68 self.gplv3_excluded = False
69 self.build_toolchain = False 68 self.build_toolchain = False
70 self.build_toolchain_headers = False 69 self.build_toolchain_headers = False
71 self.generating = False 70 self.generating = False
@@ -269,13 +268,8 @@ class HobHandler(gobject.GObject):
269 # leave the workdir in a usable state 268 # leave the workdir in a usable state
270 self.server.runCommand(["stateShutdown"]) 269 self.server.runCommand(["stateShutdown"])
271 270
272 def toggle_gplv3(self, excluded): 271 def set_incompatible_license(self, incompatible):
273 if self.gplv3_excluded != excluded: 272 self.server.runCommand(["setVariable", "INCOMPATIBLE_LICENSE", incompatible])
274 self.gplv3_excluded = excluded
275 if excluded:
276 self.server.runCommand(["setVariable", "INCOMPATIBLE_LICENSE", "GPLv3"])
277 else:
278 self.server.runCommand(["setVariable", "INCOMPATIBLE_LICENSE", ""])
279 273
280 def toggle_toolchain(self, enabled): 274 def toggle_toolchain(self, enabled):
281 if self.build_toolchain != enabled: 275 if self.build_toolchain != enabled:
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)
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index 90d5c5aa90..a5a29603c5 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -932,8 +932,14 @@ def main (server, eventHandler):
932 # PACKAGE_CLASSES and that's the package manager used for the rootfs 932 # PACKAGE_CLASSES and that's the package manager used for the rootfs
933 pkg, sep, pclass = pclasses[0].rpartition("_") 933 pkg, sep, pclass = pclasses[0].rpartition("_")
934 934
935 incompatible = server.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"])
936 gplv3disabled = False
937 if incompatible and incompatible.lower().find("gplv3"):
938 gplv3disabled = True
939
935 prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt, 940 prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt,
936 pmake, bbthread, selected_image_types, all_image_types) 941 pmake, bbthread, selected_image_types, all_image_types,
942 gplv3disabled)
937 layers = LayerEditor(configurator, None) 943 layers = LayerEditor(configurator, None)
938 window = MainWindow(taskmodel, handler, configurator, prefs, layers, mach) 944 window = MainWindow(taskmodel, handler, configurator, prefs, layers, mach)
939 prefs.set_parent_window(window) 945 prefs.set_parent_window(window)