diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-02 17:48:40 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-03 17:45:54 +0000 |
commit | d1e66643ae2e379f5e51ab9370ef8cb7e66dcb35 (patch) | |
tree | 2e129b3f58109ba30d1b8ce757f6adbe979e2601 /bitbake/lib/bb/ui/crumbs/hobeventhandler.py | |
parent | b8f0963592aa6a9ebd679fa363ca6f894b132d75 (diff) | |
download | poky-d1e66643ae2e379f5e51ab9370ef8cb7e66dcb35.tar.gz |
bitbake: cooker/command/hob: Cleanup configuration init/reset functions and commands
initConfigurationData and loadConfigurationData are similar functions, the only
reason for them appears to be to be able to reset the pre/post configuration
files. The current code is confusing and unmaintainable.
Instead this patch creates a new Sync command which allows these to be explicitly
set. The init and load functions can then be merged into one. There is then no
need for a parseConfiguration command, we can simply reset the server to have the
settings take effect.
The reset fuction is not an instant value return and triggers an event so it should
be an Async command, not a sync one.
The number of calls for the set pre/post command is probably higher than it
need be but someone with more familiarity with the hob code base can probably
figure out the right places its needed (maybe just init_cooker?).
(Bitbake rev: bae5210d7e048022f083361964ebec7daf1608f7)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hobeventhandler.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index 06a05b67f4..ce8584df4c 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py | |||
@@ -149,9 +149,7 @@ class HobHandler(gobject.GObject): | |||
149 | elif next_command == self.SUB_MATCH_CLASS: | 149 | elif next_command == self.SUB_MATCH_CLASS: |
150 | self.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"]) | 150 | self.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"]) |
151 | elif next_command == self.SUB_PARSE_CONFIG: | 151 | elif next_command == self.SUB_PARSE_CONFIG: |
152 | self.runCommand(["enableDataTracking"]) | 152 | self.runCommand(["resetCooker"]) |
153 | self.runCommand(["parseConfigurationFiles", "conf/.hob.conf", ""]) | ||
154 | self.runCommand(["disableDataTracking"]) | ||
155 | elif next_command == self.SUB_GNERATE_TGTS: | 153 | elif next_command == self.SUB_GNERATE_TGTS: |
156 | self.runCommand(["generateTargetsTree", "classes/image.bbclass", []]) | 154 | self.runCommand(["generateTargetsTree", "classes/image.bbclass", []]) |
157 | elif next_command == self.SUB_GENERATE_PKGINFO: | 155 | elif next_command == self.SUB_GENERATE_PKGINFO: |
@@ -206,7 +204,8 @@ class HobHandler(gobject.GObject): | |||
206 | reparse = self.runCommand(["getVariable", "BB_INVALIDCONF"]) or None | 204 | reparse = self.runCommand(["getVariable", "BB_INVALIDCONF"]) or None |
207 | if reparse is True: | 205 | if reparse is True: |
208 | self.set_var_in_file("BB_INVALIDCONF", False, "local.conf") | 206 | self.set_var_in_file("BB_INVALIDCONF", False, "local.conf") |
209 | self.runCommand(["parseConfigurationFiles", "conf/.hob.conf", ""]) | 207 | self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) |
208 | self.commands_async.prepend(self.SUB_PARSE_CONFIG) | ||
210 | self.run_next_command() | 209 | self.run_next_command() |
211 | 210 | ||
212 | elif isinstance(event, bb.event.SanityCheckFailed): | 211 | elif isinstance(event, bb.event.SanityCheckFailed): |
@@ -304,12 +303,8 @@ class HobHandler(gobject.GObject): | |||
304 | return | 303 | return |
305 | 304 | ||
306 | def init_cooker(self): | 305 | def init_cooker(self): |
307 | self.runCommand(["initCooker"]) | ||
308 | self.runCommand(["createConfigFile", ".hob.conf"]) | 306 | self.runCommand(["createConfigFile", ".hob.conf"]) |
309 | 307 | ||
310 | def reset_cooker(self): | ||
311 | self.runCommand(["resetCooker"]) | ||
312 | |||
313 | def set_extra_inherit(self, bbclass): | 308 | def set_extra_inherit(self, bbclass): |
314 | inherits = self.runCommand(["getVariable", "INHERIT"]) or "" | 309 | inherits = self.runCommand(["getVariable", "INHERIT"]) or "" |
315 | inherits = inherits + " " + bbclass | 310 | inherits = inherits + " " + bbclass |
@@ -409,15 +404,17 @@ class HobHandler(gobject.GObject): | |||
409 | self.run_next_command(self.NETWORK_TEST) | 404 | self.run_next_command(self.NETWORK_TEST) |
410 | 405 | ||
411 | def generate_configuration(self): | 406 | def generate_configuration(self): |
412 | self.commands_async.append(self.SUB_PARSE_CONFIG) | 407 | self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) |
413 | self.commands_async.append(self.SUB_PATH_LAYERS) | 408 | self.commands_async.append(self.SUB_PATH_LAYERS) |
414 | self.commands_async.append(self.SUB_FILES_DISTRO) | 409 | self.commands_async.append(self.SUB_FILES_DISTRO) |
415 | self.commands_async.append(self.SUB_FILES_MACH) | 410 | self.commands_async.append(self.SUB_FILES_MACH) |
416 | self.commands_async.append(self.SUB_FILES_SDKMACH) | 411 | self.commands_async.append(self.SUB_FILES_SDKMACH) |
417 | self.commands_async.append(self.SUB_MATCH_CLASS) | 412 | self.commands_async.append(self.SUB_MATCH_CLASS) |
413 | self.commands_async.append(self.SUB_PARSE_CONFIG) | ||
418 | self.run_next_command(self.GENERATE_CONFIGURATION) | 414 | self.run_next_command(self.GENERATE_CONFIGURATION) |
419 | 415 | ||
420 | def generate_recipes(self): | 416 | def generate_recipes(self): |
417 | self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) | ||
421 | self.commands_async.append(self.SUB_PARSE_CONFIG) | 418 | self.commands_async.append(self.SUB_PARSE_CONFIG) |
422 | self.commands_async.append(self.SUB_GNERATE_TGTS) | 419 | self.commands_async.append(self.SUB_GNERATE_TGTS) |
423 | self.run_next_command(self.GENERATE_RECIPES) | 420 | self.run_next_command(self.GENERATE_RECIPES) |
@@ -427,6 +424,7 @@ class HobHandler(gobject.GObject): | |||
427 | targets.extend(tgts) | 424 | targets.extend(tgts) |
428 | self.recipe_queue = targets | 425 | self.recipe_queue = targets |
429 | self.default_task = default_task | 426 | self.default_task = default_task |
427 | self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) | ||
430 | self.commands_async.append(self.SUB_PARSE_CONFIG) | 428 | self.commands_async.append(self.SUB_PARSE_CONFIG) |
431 | self.commands_async.append(self.SUB_BUILD_RECIPES) | 429 | self.commands_async.append(self.SUB_BUILD_RECIPES) |
432 | self.run_next_command(self.GENERATE_PACKAGES) | 430 | self.run_next_command(self.GENERATE_PACKAGES) |
@@ -438,6 +436,7 @@ class HobHandler(gobject.GObject): | |||
438 | self.package_queue = image_packages | 436 | self.package_queue = image_packages |
439 | self.toolchain_packages = toolchain_packages | 437 | self.toolchain_packages = toolchain_packages |
440 | self.default_task = default_task | 438 | self.default_task = default_task |
439 | self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) | ||
441 | self.commands_async.append(self.SUB_PARSE_CONFIG) | 440 | self.commands_async.append(self.SUB_PARSE_CONFIG) |
442 | self.commands_async.append(self.SUB_BUILD_IMAGE) | 441 | self.commands_async.append(self.SUB_BUILD_IMAGE) |
443 | self.run_next_command(self.GENERATE_IMAGE) | 442 | self.run_next_command(self.GENERATE_IMAGE) |