From d1e66643ae2e379f5e51ab9370ef8cb7e66dcb35 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 2 Dec 2013 17:48:40 +0000 Subject: 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 --- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs/hobeventhandler.py') 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): elif next_command == self.SUB_MATCH_CLASS: self.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"]) elif next_command == self.SUB_PARSE_CONFIG: - self.runCommand(["enableDataTracking"]) - self.runCommand(["parseConfigurationFiles", "conf/.hob.conf", ""]) - self.runCommand(["disableDataTracking"]) + self.runCommand(["resetCooker"]) elif next_command == self.SUB_GNERATE_TGTS: self.runCommand(["generateTargetsTree", "classes/image.bbclass", []]) elif next_command == self.SUB_GENERATE_PKGINFO: @@ -206,7 +204,8 @@ class HobHandler(gobject.GObject): reparse = self.runCommand(["getVariable", "BB_INVALIDCONF"]) or None if reparse is True: self.set_var_in_file("BB_INVALIDCONF", False, "local.conf") - self.runCommand(["parseConfigurationFiles", "conf/.hob.conf", ""]) + self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) + self.commands_async.prepend(self.SUB_PARSE_CONFIG) self.run_next_command() elif isinstance(event, bb.event.SanityCheckFailed): @@ -304,12 +303,8 @@ class HobHandler(gobject.GObject): return def init_cooker(self): - self.runCommand(["initCooker"]) self.runCommand(["createConfigFile", ".hob.conf"]) - def reset_cooker(self): - self.runCommand(["resetCooker"]) - def set_extra_inherit(self, bbclass): inherits = self.runCommand(["getVariable", "INHERIT"]) or "" inherits = inherits + " " + bbclass @@ -409,15 +404,17 @@ class HobHandler(gobject.GObject): self.run_next_command(self.NETWORK_TEST) def generate_configuration(self): - self.commands_async.append(self.SUB_PARSE_CONFIG) + self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) self.commands_async.append(self.SUB_PATH_LAYERS) self.commands_async.append(self.SUB_FILES_DISTRO) self.commands_async.append(self.SUB_FILES_MACH) self.commands_async.append(self.SUB_FILES_SDKMACH) self.commands_async.append(self.SUB_MATCH_CLASS) + self.commands_async.append(self.SUB_PARSE_CONFIG) self.run_next_command(self.GENERATE_CONFIGURATION) def generate_recipes(self): + self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) self.commands_async.append(self.SUB_PARSE_CONFIG) self.commands_async.append(self.SUB_GNERATE_TGTS) self.run_next_command(self.GENERATE_RECIPES) @@ -427,6 +424,7 @@ class HobHandler(gobject.GObject): targets.extend(tgts) self.recipe_queue = targets self.default_task = default_task + self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) self.commands_async.append(self.SUB_PARSE_CONFIG) self.commands_async.append(self.SUB_BUILD_RECIPES) self.run_next_command(self.GENERATE_PACKAGES) @@ -438,6 +436,7 @@ class HobHandler(gobject.GObject): self.package_queue = image_packages self.toolchain_packages = toolchain_packages self.default_task = default_task + self.runCommand(["setPrePostConfFiles", "conf/.hob.conf", ""]) self.commands_async.append(self.SUB_PARSE_CONFIG) self.commands_async.append(self.SUB_BUILD_IMAGE) self.run_next_command(self.GENERATE_IMAGE) -- cgit v1.2.3-54-g00ecf