summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-06-20 17:21:17 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-20 16:26:22 +0100
commit78bcf871c65a87df8b40a0b09654d74434e4d01c (patch)
treeda853ab6e7b266707def29a3aa8deae061ea95e2
parentf3246953c2ad20b9dc6801623a3245cc224bca3f (diff)
downloadpoky-78bcf871c65a87df8b40a0b09654d74434e4d01c.tar.gz
bitbake: hob: save variables in conf/ directory
Until now the variables were saved in bitbake configuration, now they are saved in configuration files, in order to be read by bitbake-worker. This helps to assure the consistency for the rest of the variables. (Bitbake rev: ea65ebf43525f173205183aa2fd5d8db303ffd4a) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py64
1 files changed, 34 insertions, 30 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 8fd989b6c9..1b9596f9b0 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -146,9 +146,7 @@ class HobHandler(gobject.GObject):
146 elif next_command == self.SUB_MATCH_CLASS: 146 elif next_command == self.SUB_MATCH_CLASS:
147 self.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"]) 147 self.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"])
148 elif next_command == self.SUB_PARSE_CONFIG: 148 elif next_command == self.SUB_PARSE_CONFIG:
149 self.runCommand(["enableDataTracking"]) 149 self.runCommand(["parseConfigurationFiles", "conf/.hob.conf", ""])
150 self.runCommand(["parseConfigurationFiles", "", ""])
151 self.runCommand(["disableDataTracking"])
152 elif next_command == self.SUB_GNERATE_TGTS: 150 elif next_command == self.SUB_GNERATE_TGTS:
153 self.runCommand(["generateTargetsTree", "classes/image.bbclass", []]) 151 self.runCommand(["generateTargetsTree", "classes/image.bbclass", []])
154 elif next_command == self.SUB_GENERATE_PKGINFO: 152 elif next_command == self.SUB_GENERATE_PKGINFO:
@@ -167,10 +165,10 @@ class HobHandler(gobject.GObject):
167 self.building = True 165 self.building = True
168 targets = [self.image] 166 targets = [self.image]
169 if self.package_queue: 167 if self.package_queue:
170 self.runCommand(["setVariable", "LINGUAS_INSTALL", ""]) 168 self.set_var_in_file("LINGUAS_INSTALL", "", "local.conf")
171 self.runCommand(["setVariable", "PACKAGE_INSTALL", " ".join(self.package_queue)]) 169 self.set_var_in_file("PACKAGE_INSTALL", " ".join(self.package_queue), "local.conf")
172 if self.toolchain_packages: 170 if self.toolchain_packages:
173 self.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(self.toolchain_packages)]) 171 self.set_var_in_file("TOOLCHAIN_TARGET_TASK", " ".join(self.toolchain_packages), "local.conf")
174 targets.append(self.toolchain) 172 targets.append(self.toolchain)
175 if targets[0] == "hob-image": 173 if targets[0] == "hob-image":
176 hobImage = self.runCommand(["matchFile", "hob-image.bb"]) 174 hobImage = self.runCommand(["matchFile", "hob-image.bb"])
@@ -204,8 +202,8 @@ class HobHandler(gobject.GObject):
204 elif isinstance(event, bb.event.SanityCheckPassed): 202 elif isinstance(event, bb.event.SanityCheckPassed):
205 reparse = self.runCommand(["getVariable", "BB_INVALIDCONF"]) or None 203 reparse = self.runCommand(["getVariable", "BB_INVALIDCONF"]) or None
206 if reparse is True: 204 if reparse is True:
207 self.runCommand(["setVariable", "BB_INVALIDCONF", False]) 205 self.set_var_in_file("BB_INVALIDCONF", False, "local.conf")
208 self.runCommand(["parseConfigurationFiles", "", ""]) 206 self.runCommand(["parseConfigurationFiles", "conf/.hob.conf", ""])
209 self.run_next_command() 207 self.run_next_command()
210 208
211 elif isinstance(event, bb.event.SanityCheckFailed): 209 elif isinstance(event, bb.event.SanityCheckFailed):
@@ -300,79 +298,85 @@ class HobHandler(gobject.GObject):
300 298
301 def init_cooker(self): 299 def init_cooker(self):
302 self.runCommand(["initCooker"]) 300 self.runCommand(["initCooker"])
301 self.runCommand(["createConfigFile", ".hob.conf"])
302
303 def reset_cooker(self):
304 self.runCommand(["enableDataTracking"])
305 self.runCommand(["resetCooker"])
306 self.runCommand(["disableDataTracking"])
303 307
304 def set_extra_inherit(self, bbclass): 308 def set_extra_inherit(self, bbclass):
305 inherits = self.runCommand(["getVariable", "INHERIT"]) or "" 309 inherits = self.runCommand(["getVariable", "INHERIT"]) or ""
306 inherits = inherits + " " + bbclass 310 inherits = inherits + " " + bbclass
307 self.runCommand(["setVariable", "INHERIT", inherits]) 311 self.set_var_in_file("INHERIT", inherits, ".hob.conf")
308 312
309 def set_bblayers(self, bblayers): 313 def set_bblayers(self, bblayers):
310 self.runCommand(["setVariable", "BBLAYERS", " ".join(bblayers)]) 314 self.set_var_in_file("BBLAYERS", " ".join(bblayers), "bblayers.conf")
311 315
312 def set_machine(self, machine): 316 def set_machine(self, machine):
313 if machine: 317 if machine:
314 self.runCommand(["setVariable", "MACHINE", machine]) 318 self.set_var_in_file("MACHINE", machine, "local.conf")
315 319
316 def set_sdk_machine(self, sdk_machine): 320 def set_sdk_machine(self, sdk_machine):
317 self.runCommand(["setVariable", "SDKMACHINE", sdk_machine]) 321 self.set_var_in_file("SDKMACHINE", sdk_machine, "local.conf")
318 322
319 def set_image_fstypes(self, image_fstypes): 323 def set_image_fstypes(self, image_fstypes):
320 self.runCommand(["setVariable", "IMAGE_FSTYPES", image_fstypes]) 324 self.set_var_in_file("IMAGE_FSTYPES", image_fstypes, "local.conf")
321 325
322 def set_distro(self, distro): 326 def set_distro(self, distro):
323 self.runCommand(["setVariable", "DISTRO", distro]) 327 self.set_var_in_file("DISTRO", distro, "local.conf")
324 328
325 def set_package_format(self, format): 329 def set_package_format(self, format):
326 package_classes = "" 330 package_classes = ""
327 for pkgfmt in format.split(): 331 for pkgfmt in format.split():
328 package_classes += ("package_%s" % pkgfmt + " ") 332 package_classes += ("package_%s" % pkgfmt + " ")
329 self.runCommand(["setVariable", "PACKAGE_CLASSES", package_classes]) 333 self.set_var_in_file("PACKAGE_CLASSES", package_classes, "local.conf")
330 334
331 def set_bbthreads(self, threads): 335 def set_bbthreads(self, threads):
332 self.runCommand(["setVariable", "BB_NUMBER_THREADS", threads]) 336 self.set_var_in_file("BB_NUMBER_THREADS", threads, "local.conf")
333 337
334 def set_pmake(self, threads): 338 def set_pmake(self, threads):
335 pmake = "-j %s" % threads 339 pmake = "-j %s" % threads
336 self.runCommand(["setVariable", "PARALLEL_MAKE", pmake]) 340 self.set_var_in_file("PARALLEL_MAKE", pmake, "local.conf")
337 341
338 def set_dl_dir(self, directory): 342 def set_dl_dir(self, directory):
339 self.runCommand(["setVariable", "DL_DIR", directory]) 343 self.set_var_in_file("DL_DIR", directory, "local.conf")
340 344
341 def set_sstate_dir(self, directory): 345 def set_sstate_dir(self, directory):
342 self.runCommand(["setVariable", "SSTATE_DIR", directory]) 346 self.set_var_in_file("SSTATE_DIR", directory, "local.conf")
343 347
344 def set_sstate_mirrors(self, url): 348 def set_sstate_mirrors(self, url):
345 self.runCommand(["setVariable", "SSTATE_MIRRORS", url]) 349 self.set_var_in_file("SSTATE_MIRRORS", url, "local.conf")
346 350
347 def set_extra_size(self, image_extra_size): 351 def set_extra_size(self, image_extra_size):
348 self.runCommand(["setVariable", "IMAGE_ROOTFS_EXTRA_SPACE", str(image_extra_size)]) 352 self.set_var_in_file("IMAGE_ROOTFS_EXTRA_SPACE", str(image_extra_size), "local.conf")
349 353
350 def set_rootfs_size(self, image_rootfs_size): 354 def set_rootfs_size(self, image_rootfs_size):
351 self.runCommand(["setVariable", "IMAGE_ROOTFS_SIZE", str(image_rootfs_size)]) 355 self.set_var_in_file("IMAGE_ROOTFS_SIZE", str(image_rootfs_size), "local.conf")
352 356
353 def set_incompatible_license(self, incompat_license): 357 def set_incompatible_license(self, incompat_license):
354 self.runCommand(["setVariable", "INCOMPATIBLE_LICENSE", incompat_license]) 358 self.set_var_in_file("INCOMPATIBLE_LICENSE", incompat_license, "local.conf")
355 359
356 def set_extra_config(self, extra_setting): 360 def set_extra_config(self, extra_setting):
357 for key in extra_setting.keys(): 361 for key in extra_setting.keys():
358 value = extra_setting[key] 362 value = extra_setting[key]
359 self.runCommand(["setVariable", key, value]) 363 self.set_var_in_file(key, value, "local.conf")
360 364
361 def set_http_proxy(self, http_proxy): 365 def set_http_proxy(self, http_proxy):
362 self.runCommand(["setVariable", "http_proxy", http_proxy]) 366 self.set_var_in_file("http_proxy", http_proxy, "local.conf")
363 367
364 def set_https_proxy(self, https_proxy): 368 def set_https_proxy(self, https_proxy):
365 self.runCommand(["setVariable", "https_proxy", https_proxy]) 369 self.set_var_in_file("https_proxy", https_proxy, "local.conf")
366 370
367 def set_ftp_proxy(self, ftp_proxy): 371 def set_ftp_proxy(self, ftp_proxy):
368 self.runCommand(["setVariable", "ftp_proxy", ftp_proxy]) 372 self.set_var_in_file("ftp_proxy", ftp_proxy, "local.conf")
369 373
370 def set_socks_proxy(self, socks_proxy): 374 def set_socks_proxy(self, socks_proxy):
371 self.runCommand(["setVariable", "all_proxy", socks_proxy]) 375 self.set_var_in_file("all_proxy", socks_proxy, "local.conf")
372 376
373 def set_cvs_proxy(self, host, port): 377 def set_cvs_proxy(self, host, port):
374 self.runCommand(["setVariable", "CVS_PROXY_HOST", host]) 378 self.set_var_in_file("CVS_PROXY_HOST", host, "local.conf")
375 self.runCommand(["setVariable", "CVS_PROXY_PORT", port]) 379 self.set_var_in_file("CVS_PROXY_PORT", port, "local.conf")
376 380
377 def request_package_info(self): 381 def request_package_info(self):
378 self.commands_async.append(self.SUB_GENERATE_PKGINFO) 382 self.commands_async.append(self.SUB_GENERATE_PKGINFO)