summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs
diff options
context:
space:
mode:
authorShane Wang <shane.wang@intel.com>2012-04-16 00:09:25 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-15 17:31:57 +0100
commit2e01a44f3b8406fa2dbcb1cc2061784a2a099eac (patch)
tree226e3c4006d1ce0ac5ec1fda21488fdf33b36500 /bitbake/lib/bb/ui/crumbs
parente3e6d2a7445ef64b0a1a3d740ef4414d5fca9793 (diff)
downloadpoky-2e01a44f3b8406fa2dbcb1cc2061784a2a099eac.tar.gz
Hob: add exception handling
Create a wrapper with exception handling to call self.server.runCommand() safely. Again, add exception handling to load_template() and save_template() (Bitbake rev: cb07a027d3366ed30b0f7e5e85d08c6fda4eb5b9) Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py56
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py175
2 files changed, 128 insertions, 103 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index cd66c3fc9d..bd45016045 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -464,11 +464,15 @@ class Builder(gtk.Window):
464 return None 464 return None
465 465
466 self.template = TemplateMgr() 466 self.template = TemplateMgr()
467 self.template.load(path) 467 try:
468 self.configuration.load(self.template) 468 self.template.load(path)
469 469 self.configuration.load(self.template)
470 self.template.destroy() 470 except Exception as e:
471 self.template = None 471 self.show_error_dialog("Hob Exception - %s" % (str(e)))
472 self.reset()
473 finally:
474 self.template.destroy()
475 self.template = None
472 476
473 for layer in self.configuration.layers: 477 for layer in self.configuration.layers:
474 if not os.path.exists(layer+'/conf/layer.conf'): 478 if not os.path.exists(layer+'/conf/layer.conf'):
@@ -487,12 +491,17 @@ class Builder(gtk.Window):
487 path = path[0:path.rfind("/")] 491 path = path[0:path.rfind("/")]
488 492
489 self.template = TemplateMgr() 493 self.template = TemplateMgr()
490 self.template.open(filename, path) 494 try:
491 self.configuration.save(self.template, defaults) 495 self.template.open(filename, path)
496 self.configuration.save(self.template, defaults)
492 497
493 self.template.save() 498 self.template.save()
494 self.template.destroy() 499 except Exception as e:
495 self.template = None 500 self.show_error_dialog("Hob Exception - %s" % (str(e)))
501 self.reset()
502 finally:
503 self.template.destroy()
504 self.template = None
496 505
497 def save_defaults(self): 506 def save_defaults(self):
498 if not os.path.exists(".hob/"): 507 if not os.path.exists(".hob/"):
@@ -587,6 +596,12 @@ class Builder(gtk.Window):
587 self.configuration.update(params) 596 self.configuration.update(params)
588 self.parameters.update(params) 597 self.parameters.update(params)
589 598
599 def reset(self):
600 self.configuration.curr_mach = ""
601 self.configuration.clear_selection()
602 self.image_configuration_page.switch_machine_combo()
603 self.switch_page(self.MACHINE_SELECTION)
604
590 # Callback Functions 605 # Callback Functions
591 def handler_config_updated_cb(self, handler, which, values): 606 def handler_config_updated_cb(self, handler, which, values):
592 if which == "distro": 607 if which == "distro":
@@ -619,19 +634,20 @@ class Builder(gtk.Window):
619 if self.current_step == self.FAST_IMAGE_GENERATING: 634 if self.current_step == self.FAST_IMAGE_GENERATING:
620 self.generate_image_async() 635 self.generate_image_async()
621 636
637 def show_error_dialog(self, msg):
638 lbl = "<b>Error</b>\n"
639 lbl = lbl + "%s\n\n" % msg
640 dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_ERROR)
641 button = dialog.add_button("Close", gtk.RESPONSE_OK)
642 HobButton.style_button(button)
643 response = dialog.run()
644 dialog.destroy()
645
622 def handler_command_failed_cb(self, handler, msg): 646 def handler_command_failed_cb(self, handler, msg):
623 if msg: 647 if msg:
624 msg = msg.replace("your local.conf", "Settings") 648 msg = msg.replace("your local.conf", "Settings")
625 lbl = "<b>Error</b>\n" 649 self.show_error_dialog(msg)
626 lbl = lbl + "%s\n\n" % msg 650 self.reset()
627 dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_ERROR)
628 button = dialog.add_button("Close", gtk.RESPONSE_OK)
629 HobButton.style_button(button)
630 response = dialog.run()
631 dialog.destroy()
632 self.configuration.curr_mach = ""
633 self.image_configuration_page.switch_machine_combo()
634 self.switch_page(self.MACHINE_SELECTION)
635 651
636 def window_sensitive(self, sensitive): 652 def window_sensitive(self, sensitive):
637 self.image_configuration_page.machine_combo.set_sensitive(sensitive) 653 self.image_configuration_page.machine_combo.set_sensitive(sensitive)
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 216b4065ec..ebfc388f73 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -91,6 +91,15 @@ class HobHandler(gobject.GObject):
91 self.emit("data-generated") 91 self.emit("data-generated")
92 self.generating = False 92 self.generating = False
93 93
94 def runCommand(self, commandline):
95 try:
96 return self.server.runCommand(commandline)
97 except Exception as e:
98 self.commands_async = []
99 self.clear_busy()
100 self.emit("command-failed", "Hob Exception - %s" % (str(e)))
101 return None
102
94 def run_next_command(self, initcmd=None): 103 def run_next_command(self, initcmd=None):
95 if initcmd != None: 104 if initcmd != None:
96 self.initcmd = initcmd 105 self.initcmd = initcmd
@@ -105,37 +114,37 @@ class HobHandler(gobject.GObject):
105 return 114 return
106 115
107 if next_command == self.SUB_PATH_LAYERS: 116 if next_command == self.SUB_PATH_LAYERS:
108 self.server.runCommand(["findConfigFilePath", "bblayers.conf"]) 117 self.runCommand(["findConfigFilePath", "bblayers.conf"])
109 elif next_command == self.SUB_FILES_DISTRO: 118 elif next_command == self.SUB_FILES_DISTRO:
110 self.server.runCommand(["findConfigFiles", "DISTRO"]) 119 self.runCommand(["findConfigFiles", "DISTRO"])
111 elif next_command == self.SUB_FILES_MACH: 120 elif next_command == self.SUB_FILES_MACH:
112 self.server.runCommand(["findConfigFiles", "MACHINE"]) 121 self.runCommand(["findConfigFiles", "MACHINE"])
113 elif next_command == self.SUB_FILES_SDKMACH: 122 elif next_command == self.SUB_FILES_SDKMACH:
114 self.server.runCommand(["findConfigFiles", "MACHINE-SDK"]) 123 self.runCommand(["findConfigFiles", "MACHINE-SDK"])
115 elif next_command == self.SUB_MATCH_CLASS: 124 elif next_command == self.SUB_MATCH_CLASS:
116 self.server.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"]) 125 self.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"])
117 elif next_command == self.SUB_PARSE_CONFIG: 126 elif next_command == self.SUB_PARSE_CONFIG:
118 self.server.runCommand(["parseConfigurationFiles", "", ""]) 127 self.runCommand(["parseConfigurationFiles", "", ""])
119 elif next_command == self.SUB_GNERATE_TGTS: 128 elif next_command == self.SUB_GNERATE_TGTS:
120 self.server.runCommand(["generateTargetsTree", "classes/image.bbclass", []]) 129 self.runCommand(["generateTargetsTree", "classes/image.bbclass", []])
121 elif next_command == self.SUB_GENERATE_PKGINFO: 130 elif next_command == self.SUB_GENERATE_PKGINFO:
122 self.server.runCommand(["triggerEvent", "bb.event.RequestPackageInfo()"]) 131 self.runCommand(["triggerEvent", "bb.event.RequestPackageInfo()"])
123 elif next_command == self.SUB_BUILD_RECIPES: 132 elif next_command == self.SUB_BUILD_RECIPES:
124 self.clear_busy() 133 self.clear_busy()
125 self.building = True 134 self.building = True
126 self.server.runCommand(["buildTargets", self.recipe_queue, self.default_task]) 135 self.runCommand(["buildTargets", self.recipe_queue, self.default_task])
127 self.recipe_queue = [] 136 self.recipe_queue = []
128 elif next_command == self.SUB_BUILD_IMAGE: 137 elif next_command == self.SUB_BUILD_IMAGE:
129 self.clear_busy() 138 self.clear_busy()
130 self.building = True 139 self.building = True
131 targets = [self.image] 140 targets = [self.image]
132 if self.package_queue: 141 if self.package_queue:
133 self.server.runCommand(["setVariable", "LINGUAS_INSTALL", ""]) 142 self.runCommand(["setVariable", "LINGUAS_INSTALL", ""])
134 self.server.runCommand(["setVariable", "PACKAGE_INSTALL", " ".join(self.package_queue)]) 143 self.runCommand(["setVariable", "PACKAGE_INSTALL", " ".join(self.package_queue)])
135 if self.toolchain_packages: 144 if self.toolchain_packages:
136 self.server.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(self.toolchain_packages)]) 145 self.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(self.toolchain_packages)])
137 targets.append(self.toolchain) 146 targets.append(self.toolchain)
138 self.server.runCommand(["buildTargets", targets, self.default_task]) 147 self.runCommand(["buildTargets", targets, self.default_task])
139 148
140 def handle_event(self, event): 149 def handle_event(self, event):
141 if not event: 150 if not event:
@@ -217,87 +226,87 @@ class HobHandler(gobject.GObject):
217 return 226 return
218 227
219 def init_cooker(self): 228 def init_cooker(self):
220 self.server.runCommand(["initCooker"]) 229 self.runCommand(["initCooker"])
221 230
222 def set_extra_inherit(self, bbclass): 231 def set_extra_inherit(self, bbclass):
223 inherits = self.server.runCommand(["getVariable", "INHERIT"]) or "" 232 inherits = self.runCommand(["getVariable", "INHERIT"]) or ""
224 inherits = inherits + " " + bbclass 233 inherits = inherits + " " + bbclass
225 self.server.runCommand(["setVariable", "INHERIT", inherits]) 234 self.runCommand(["setVariable", "INHERIT", inherits])
226 235
227 def set_bblayers(self, bblayers): 236 def set_bblayers(self, bblayers):
228 self.server.runCommand(["setVariable", "BBLAYERS_HOB", " ".join(bblayers)]) 237 self.runCommand(["setVariable", "BBLAYERS_HOB", " ".join(bblayers)])
229 238
230 def set_machine(self, machine): 239 def set_machine(self, machine):
231 if machine: 240 if machine:
232 self.server.runCommand(["setVariable", "MACHINE_HOB", machine]) 241 self.runCommand(["setVariable", "MACHINE_HOB", machine])
233 242
234 def set_sdk_machine(self, sdk_machine): 243 def set_sdk_machine(self, sdk_machine):
235 self.server.runCommand(["setVariable", "SDKMACHINE_HOB", sdk_machine]) 244 self.runCommand(["setVariable", "SDKMACHINE_HOB", sdk_machine])
236 245
237 def set_image_fstypes(self, image_fstypes): 246 def set_image_fstypes(self, image_fstypes):
238 self.server.runCommand(["setVariable", "IMAGE_FSTYPES", image_fstypes]) 247 self.runCommand(["setVariable", "IMAGE_FSTYPES", image_fstypes])
239 248
240 def set_distro(self, distro): 249 def set_distro(self, distro):
241 self.server.runCommand(["setVariable", "DISTRO_HOB", distro]) 250 self.runCommand(["setVariable", "DISTRO_HOB", distro])
242 251
243 def set_package_format(self, format): 252 def set_package_format(self, format):
244 package_classes = "" 253 package_classes = ""
245 for pkgfmt in format.split(): 254 for pkgfmt in format.split():
246 package_classes += ("package_%s" % pkgfmt + " ") 255 package_classes += ("package_%s" % pkgfmt + " ")
247 self.server.runCommand(["setVariable", "PACKAGE_CLASSES_HOB", package_classes]) 256 self.runCommand(["setVariable", "PACKAGE_CLASSES_HOB", package_classes])
248 257
249 def set_bbthreads(self, threads): 258 def set_bbthreads(self, threads):
250 self.server.runCommand(["setVariable", "BB_NUMBER_THREADS_HOB", threads]) 259 self.runCommand(["setVariable", "BB_NUMBER_THREADS_HOB", threads])
251 260
252 def set_pmake(self, threads): 261 def set_pmake(self, threads):
253 pmake = "-j %s" % threads 262 pmake = "-j %s" % threads
254 self.server.runCommand(["setVariable", "PARALLEL_MAKE_HOB", pmake]) 263 self.runCommand(["setVariable", "PARALLEL_MAKE_HOB", pmake])
255 264
256 def set_dl_dir(self, directory): 265 def set_dl_dir(self, directory):
257 self.server.runCommand(["setVariable", "DL_DIR_HOB", directory]) 266 self.runCommand(["setVariable", "DL_DIR_HOB", directory])
258 267
259 def set_sstate_dir(self, directory): 268 def set_sstate_dir(self, directory):
260 self.server.runCommand(["setVariable", "SSTATE_DIR_HOB", directory]) 269 self.runCommand(["setVariable", "SSTATE_DIR_HOB", directory])
261 270
262 def set_sstate_mirror(self, url): 271 def set_sstate_mirror(self, url):
263 self.server.runCommand(["setVariable", "SSTATE_MIRROR_HOB", url]) 272 self.runCommand(["setVariable", "SSTATE_MIRROR_HOB", url])
264 273
265 def set_extra_size(self, image_extra_size): 274 def set_extra_size(self, image_extra_size):
266 self.server.runCommand(["setVariable", "IMAGE_ROOTFS_EXTRA_SPACE", str(image_extra_size)]) 275 self.runCommand(["setVariable", "IMAGE_ROOTFS_EXTRA_SPACE", str(image_extra_size)])
267 276
268 def set_rootfs_size(self, image_rootfs_size): 277 def set_rootfs_size(self, image_rootfs_size):
269 self.server.runCommand(["setVariable", "IMAGE_ROOTFS_SIZE", str(image_rootfs_size)]) 278 self.runCommand(["setVariable", "IMAGE_ROOTFS_SIZE", str(image_rootfs_size)])
270 279
271 def set_incompatible_license(self, incompat_license): 280 def set_incompatible_license(self, incompat_license):
272 self.server.runCommand(["setVariable", "INCOMPATIBLE_LICENSE_HOB", incompat_license]) 281 self.runCommand(["setVariable", "INCOMPATIBLE_LICENSE_HOB", incompat_license])
273 282
274 def set_extra_config(self, extra_setting): 283 def set_extra_config(self, extra_setting):
275 for key in extra_setting.keys(): 284 for key in extra_setting.keys():
276 value = extra_setting[key] 285 value = extra_setting[key]
277 self.server.runCommand(["setVariable", key, value]) 286 self.runCommand(["setVariable", key, value])
278 287
279 def set_config_filter(self, config_filter): 288 def set_config_filter(self, config_filter):
280 self.server.runCommand(["setConfFilter", config_filter]) 289 self.runCommand(["setConfFilter", config_filter])
281 290
282 def set_http_proxy(self, http_proxy): 291 def set_http_proxy(self, http_proxy):
283 self.server.runCommand(["setVariable", "http_proxy", http_proxy]) 292 self.runCommand(["setVariable", "http_proxy", http_proxy])
284 293
285 def set_https_proxy(self, https_proxy): 294 def set_https_proxy(self, https_proxy):
286 self.server.runCommand(["setVariable", "https_proxy", https_proxy]) 295 self.runCommand(["setVariable", "https_proxy", https_proxy])
287 296
288 def set_ftp_proxy(self, ftp_proxy): 297 def set_ftp_proxy(self, ftp_proxy):
289 self.server.runCommand(["setVariable", "ftp_proxy", ftp_proxy]) 298 self.runCommand(["setVariable", "ftp_proxy", ftp_proxy])
290 299
291 def set_all_proxy(self, all_proxy): 300 def set_all_proxy(self, all_proxy):
292 self.server.runCommand(["setVariable", "all_proxy", all_proxy]) 301 self.runCommand(["setVariable", "all_proxy", all_proxy])
293 302
294 def set_git_proxy(self, host, port): 303 def set_git_proxy(self, host, port):
295 self.server.runCommand(["setVariable", "GIT_PROXY_HOST", host]) 304 self.runCommand(["setVariable", "GIT_PROXY_HOST", host])
296 self.server.runCommand(["setVariable", "GIT_PROXY_PORT", port]) 305 self.runCommand(["setVariable", "GIT_PROXY_PORT", port])
297 306
298 def set_cvs_proxy(self, host, port): 307 def set_cvs_proxy(self, host, port):
299 self.server.runCommand(["setVariable", "CVS_PROXY_HOST", host]) 308 self.runCommand(["setVariable", "CVS_PROXY_HOST", host])
300 self.server.runCommand(["setVariable", "CVS_PROXY_PORT", port]) 309 self.runCommand(["setVariable", "CVS_PROXY_PORT", port])
301 310
302 def request_package_info(self): 311 def request_package_info(self):
303 self.commands_async.append(self.SUB_GENERATE_PKGINFO) 312 self.commands_async.append(self.SUB_GENERATE_PKGINFO)
@@ -345,16 +354,16 @@ class HobHandler(gobject.GObject):
345 self.building = False 354 self.building = False
346 355
347 def cancel_parse(self): 356 def cancel_parse(self):
348 self.server.runCommand(["stateStop"]) 357 self.runCommand(["stateStop"])
349 358
350 def cancel_build(self, force=False): 359 def cancel_build(self, force=False):
351 if force: 360 if force:
352 # Force the cooker to stop as quickly as possible 361 # Force the cooker to stop as quickly as possible
353 self.server.runCommand(["stateStop"]) 362 self.runCommand(["stateStop"])
354 else: 363 else:
355 # Wait for tasks to complete before shutting down, this helps 364 # Wait for tasks to complete before shutting down, this helps
356 # leave the workdir in a usable state 365 # leave the workdir in a usable state
357 self.server.runCommand(["stateShutdown"]) 366 self.runCommand(["stateShutdown"])
358 367
359 def reset_build(self): 368 def reset_build(self):
360 self.build.reset() 369 self.build.reset()
@@ -369,19 +378,19 @@ class HobHandler(gobject.GObject):
369 def get_parameters(self): 378 def get_parameters(self):
370 # retrieve the parameters from bitbake 379 # retrieve the parameters from bitbake
371 params = {} 380 params = {}
372 params["core_base"] = self.server.runCommand(["getVariable", "COREBASE"]) or "" 381 params["core_base"] = self.runCommand(["getVariable", "COREBASE"]) or ""
373 hob_layer = params["core_base"] + "/meta-hob" 382 hob_layer = params["core_base"] + "/meta-hob"
374 params["layer"] = self.server.runCommand(["getVariable", "BBLAYERS"]) or "" 383 params["layer"] = self.runCommand(["getVariable", "BBLAYERS"]) or ""
375 if hob_layer not in params["layer"].split(): 384 if hob_layer not in params["layer"].split():
376 params["layer"] += (" " + hob_layer) 385 params["layer"] += (" " + hob_layer)
377 params["dldir"] = self.server.runCommand(["getVariable", "DL_DIR"]) or "" 386 params["dldir"] = self.runCommand(["getVariable", "DL_DIR"]) or ""
378 params["machine"] = self.server.runCommand(["getVariable", "MACHINE"]) or "" 387 params["machine"] = self.runCommand(["getVariable", "MACHINE"]) or ""
379 params["distro"] = self.server.runCommand(["getVariable", "DISTRO"]) or "defaultsetup" 388 params["distro"] = self.runCommand(["getVariable", "DISTRO"]) or "defaultsetup"
380 params["pclass"] = self.server.runCommand(["getVariable", "PACKAGE_CLASSES"]) or "" 389 params["pclass"] = self.runCommand(["getVariable", "PACKAGE_CLASSES"]) or ""
381 params["sstatedir"] = self.server.runCommand(["getVariable", "SSTATE_DIR"]) or "" 390 params["sstatedir"] = self.runCommand(["getVariable", "SSTATE_DIR"]) or ""
382 params["sstatemirror"] = self.server.runCommand(["getVariable", "SSTATE_MIRROR"]) or "" 391 params["sstatemirror"] = self.runCommand(["getVariable", "SSTATE_MIRROR"]) or ""
383 392
384 num_threads = self.server.runCommand(["getCpuCount"]) 393 num_threads = self.runCommand(["getCpuCount"])
385 if not num_threads: 394 if not num_threads:
386 num_threads = 1 395 num_threads = 1
387 max_threads = 65536 396 max_threads = 65536
@@ -394,7 +403,7 @@ class HobHandler(gobject.GObject):
394 max_threads = 65536 403 max_threads = 65536
395 params["max_threads"] = max_threads 404 params["max_threads"] = max_threads
396 405
397 bbthread = self.server.runCommand(["getVariable", "BB_NUMBER_THREADS"]) 406 bbthread = self.runCommand(["getVariable", "BB_NUMBER_THREADS"])
398 if not bbthread: 407 if not bbthread:
399 bbthread = num_threads 408 bbthread = num_threads
400 else: 409 else:
@@ -404,7 +413,7 @@ class HobHandler(gobject.GObject):
404 bbthread = num_threads 413 bbthread = num_threads
405 params["bbthread"] = bbthread 414 params["bbthread"] = bbthread
406 415
407 pmake = self.server.runCommand(["getVariable", "PARALLEL_MAKE"]) 416 pmake = self.runCommand(["getVariable", "PARALLEL_MAKE"])
408 if not pmake: 417 if not pmake:
409 pmake = num_threads 418 pmake = num_threads
410 elif isinstance(pmake, int): 419 elif isinstance(pmake, int):
@@ -416,9 +425,9 @@ class HobHandler(gobject.GObject):
416 pmake = num_threads 425 pmake = num_threads
417 params["pmake"] = "-j %s" % pmake 426 params["pmake"] = "-j %s" % pmake
418 427
419 params["image_addr"] = self.server.runCommand(["getVariable", "DEPLOY_DIR_IMAGE"]) or "" 428 params["image_addr"] = self.runCommand(["getVariable", "DEPLOY_DIR_IMAGE"]) or ""
420 429
421 image_extra_size = self.server.runCommand(["getVariable", "IMAGE_ROOTFS_EXTRA_SPACE"]) 430 image_extra_size = self.runCommand(["getVariable", "IMAGE_ROOTFS_EXTRA_SPACE"])
422 if not image_extra_size: 431 if not image_extra_size:
423 image_extra_size = 0 432 image_extra_size = 0
424 else: 433 else:
@@ -428,7 +437,7 @@ class HobHandler(gobject.GObject):
428 image_extra_size = 0 437 image_extra_size = 0
429 params["image_extra_size"] = image_extra_size 438 params["image_extra_size"] = image_extra_size
430 439
431 image_rootfs_size = self.server.runCommand(["getVariable", "IMAGE_ROOTFS_SIZE"]) 440 image_rootfs_size = self.runCommand(["getVariable", "IMAGE_ROOTFS_SIZE"])
432 if not image_rootfs_size: 441 if not image_rootfs_size:
433 image_rootfs_size = 0 442 image_rootfs_size = 0
434 else: 443 else:
@@ -438,7 +447,7 @@ class HobHandler(gobject.GObject):
438 image_rootfs_size = 0 447 image_rootfs_size = 0
439 params["image_rootfs_size"] = image_rootfs_size 448 params["image_rootfs_size"] = image_rootfs_size
440 449
441 image_overhead_factor = self.server.runCommand(["getVariable", "IMAGE_OVERHEAD_FACTOR"]) 450 image_overhead_factor = self.runCommand(["getVariable", "IMAGE_OVERHEAD_FACTOR"])
442 if not image_overhead_factor: 451 if not image_overhead_factor:
443 image_overhead_factor = 1 452 image_overhead_factor = 1
444 else: 453 else:
@@ -448,37 +457,37 @@ class HobHandler(gobject.GObject):
448 image_overhead_factor = 1 457 image_overhead_factor = 1
449 params['image_overhead_factor'] = image_overhead_factor 458 params['image_overhead_factor'] = image_overhead_factor
450 459
451 params["incompat_license"] = self._remove_redundant(self.server.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"]) or "") 460 params["incompat_license"] = self._remove_redundant(self.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"]) or "")
452 params["sdk_machine"] = self.server.runCommand(["getVariable", "SDKMACHINE"]) or self.server.runCommand(["getVariable", "SDK_ARCH"]) or "" 461 params["sdk_machine"] = self.runCommand(["getVariable", "SDKMACHINE"]) or self.runCommand(["getVariable", "SDK_ARCH"]) or ""
453 462
454 params["image_fstypes"] = self._remove_redundant(self.server.runCommand(["getVariable", "IMAGE_FSTYPES"]) or "") 463 params["image_fstypes"] = self._remove_redundant(self.runCommand(["getVariable", "IMAGE_FSTYPES"]) or "")
455 464
456 params["image_types"] = self._remove_redundant(self.server.runCommand(["getVariable", "IMAGE_TYPES"]) or "") 465 params["image_types"] = self._remove_redundant(self.runCommand(["getVariable", "IMAGE_TYPES"]) or "")
457 466
458 params["conf_version"] = self.server.runCommand(["getVariable", "CONF_VERSION"]) or "" 467 params["conf_version"] = self.runCommand(["getVariable", "CONF_VERSION"]) or ""
459 params["lconf_version"] = self.server.runCommand(["getVariable", "LCONF_VERSION"]) or "" 468 params["lconf_version"] = self.runCommand(["getVariable", "LCONF_VERSION"]) or ""
460 469
461 params["runnable_image_types"] = self._remove_redundant(self.server.runCommand(["getVariable", "RUNNABLE_IMAGE_TYPES"]) or "") 470 params["runnable_image_types"] = self._remove_redundant(self.runCommand(["getVariable", "RUNNABLE_IMAGE_TYPES"]) or "")
462 params["runnable_machine_patterns"] = self._remove_redundant(self.server.runCommand(["getVariable", "RUNNABLE_MACHINE_PATTERNS"]) or "") 471 params["runnable_machine_patterns"] = self._remove_redundant(self.runCommand(["getVariable", "RUNNABLE_MACHINE_PATTERNS"]) or "")
463 params["deployable_image_types"] = self._remove_redundant(self.server.runCommand(["getVariable", "DEPLOYABLE_IMAGE_TYPES"]) or "") 472 params["deployable_image_types"] = self._remove_redundant(self.runCommand(["getVariable", "DEPLOYABLE_IMAGE_TYPES"]) or "")
464 params["tmpdir"] = self.server.runCommand(["getVariable", "TMPDIR"]) or "" 473 params["tmpdir"] = self.runCommand(["getVariable", "TMPDIR"]) or ""
465 params["distro_version"] = self.server.runCommand(["getVariable", "DISTRO_VERSION"]) or "" 474 params["distro_version"] = self.runCommand(["getVariable", "DISTRO_VERSION"]) or ""
466 params["target_os"] = self.server.runCommand(["getVariable", "TARGET_OS"]) or "" 475 params["target_os"] = self.runCommand(["getVariable", "TARGET_OS"]) or ""
467 params["target_arch"] = self.server.runCommand(["getVariable", "TARGET_ARCH"]) or "" 476 params["target_arch"] = self.runCommand(["getVariable", "TARGET_ARCH"]) or ""
468 params["tune_pkgarch"] = self.server.runCommand(["getVariable", "TUNE_PKGARCH"]) or "" 477 params["tune_pkgarch"] = self.runCommand(["getVariable", "TUNE_PKGARCH"]) or ""
469 params["bb_version"] = self.server.runCommand(["getVariable", "BB_MIN_VERSION"]) or "" 478 params["bb_version"] = self.runCommand(["getVariable", "BB_MIN_VERSION"]) or ""
470 479
471 params["default_task"] = self.server.runCommand(["getVariable", "BB_DEFAULT_TASK"]) or "build" 480 params["default_task"] = self.runCommand(["getVariable", "BB_DEFAULT_TASK"]) or "build"
472 481
473 params["git_proxy_host"] = self.server.runCommand(["getVariable", "GIT_PROXY_HOST"]) or "" 482 params["git_proxy_host"] = self.runCommand(["getVariable", "GIT_PROXY_HOST"]) or ""
474 params["git_proxy_port"] = self.server.runCommand(["getVariable", "GIT_PROXY_PORT"]) or "" 483 params["git_proxy_port"] = self.runCommand(["getVariable", "GIT_PROXY_PORT"]) or ""
475 484
476 params["http_proxy"] = self.server.runCommand(["getVariable", "http_proxy"]) or "" 485 params["http_proxy"] = self.runCommand(["getVariable", "http_proxy"]) or ""
477 params["ftp_proxy"] = self.server.runCommand(["getVariable", "ftp_proxy"]) or "" 486 params["ftp_proxy"] = self.runCommand(["getVariable", "ftp_proxy"]) or ""
478 params["https_proxy"] = self.server.runCommand(["getVariable", "https_proxy"]) or "" 487 params["https_proxy"] = self.runCommand(["getVariable", "https_proxy"]) or ""
479 params["all_proxy"] = self.server.runCommand(["getVariable", "all_proxy"]) or "" 488 params["all_proxy"] = self.runCommand(["getVariable", "all_proxy"]) or ""
480 489
481 params["cvs_proxy_host"] = self.server.runCommand(["getVariable", "CVS_PROXY_HOST"]) or "" 490 params["cvs_proxy_host"] = self.runCommand(["getVariable", "CVS_PROXY_HOST"]) or ""
482 params["cvs_proxy_port"] = self.server.runCommand(["getVariable", "CVS_PROXY_PORT"]) or "" 491 params["cvs_proxy_port"] = self.runCommand(["getVariable", "CVS_PROXY_PORT"]) or ""
483 492
484 return params 493 return params