diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-24 14:57:01 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-25 18:14:53 +0100 |
commit | 0bcc00ac517bdb9a8035397fcac0a402fe1aad13 (patch) | |
tree | d4aa8bd9e8660e1e7bb5ac752523237f9b7d5e44 /bitbake/lib/bb/command.py | |
parent | 59421f688ce5a6ca95e7a02bb4e517b4690cad8c (diff) | |
download | poky-0bcc00ac517bdb9a8035397fcac0a402fe1aad13.tar.gz |
bitbake: cooker: Defer configuration init to after UI connection
Currently we end up parsing the base configuration multiple times as
initially, the right settings haven't come from the UI. We can defer
this until later in startup using runCommand as a trigger.
The advantage to doing this is improved startup times and ultimately
we should be able to avoid the double parse of the base configuration.
(Bitbake rev: 3caa43b665604475d2c87ba505efb0b9fca9c2e9)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r-- | bitbake/lib/bb/command.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 4d152ff4c0..d4dcc653a0 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -54,13 +54,20 @@ class Command: | |||
54 | self.cooker = cooker | 54 | self.cooker = cooker |
55 | self.cmds_sync = CommandsSync() | 55 | self.cmds_sync = CommandsSync() |
56 | self.cmds_async = CommandsAsync() | 56 | self.cmds_async = CommandsAsync() |
57 | self.remotedatastores = bb.remotedata.RemoteDatastores(cooker) | 57 | self.remotedatastores = None |
58 | 58 | ||
59 | # FIXME Add lock for this | 59 | # FIXME Add lock for this |
60 | self.currentAsyncCommand = None | 60 | self.currentAsyncCommand = None |
61 | 61 | ||
62 | def runCommand(self, commandline, ro_only = False): | 62 | def runCommand(self, commandline, ro_only = False): |
63 | command = commandline.pop(0) | 63 | command = commandline.pop(0) |
64 | |||
65 | # Ensure cooker is ready for commands | ||
66 | if command != "updateConfig" and command != "setFeatures": | ||
67 | self.cooker.init_configdata() | ||
68 | if not self.remotedatastores: | ||
69 | self.remotedatastores = bb.remotedata.RemoteDatastores(self.cooker) | ||
70 | |||
64 | if hasattr(CommandsSync, command): | 71 | if hasattr(CommandsSync, command): |
65 | # Can run synchronous commands straight away | 72 | # Can run synchronous commands straight away |
66 | command_method = getattr(self.cmds_sync, command) | 73 | command_method = getattr(self.cmds_sync, command) |