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-24 17:48:12 +0100 |
commit | 3caa43b665604475d2c87ba505efb0b9fca9c2e9 (patch) | |
tree | 26e05c7017d6ff25193193341ea0631d7eda4dd1 /lib/bb/command.py | |
parent | f7d2c9116116659ea42260a3bb96dca100aadae7 (diff) | |
download | bitbake-3caa43b665604475d2c87ba505efb0b9fca9c2e9.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/command.py')
-rw-r--r-- | lib/bb/command.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py index 4d152ff4c..d4dcc653a 100644 --- a/lib/bb/command.py +++ b/lib/bb/command.py @@ -54,13 +54,20 @@ class Command: self.cooker = cooker self.cmds_sync = CommandsSync() self.cmds_async = CommandsAsync() - self.remotedatastores = bb.remotedata.RemoteDatastores(cooker) + self.remotedatastores = None # FIXME Add lock for this self.currentAsyncCommand = None def runCommand(self, commandline, ro_only = False): command = commandline.pop(0) + + # Ensure cooker is ready for commands + if command != "updateConfig" and command != "setFeatures": + self.cooker.init_configdata() + if not self.remotedatastores: + self.remotedatastores = bb.remotedata.RemoteDatastores(self.cooker) + if hasattr(CommandsSync, command): # Can run synchronous commands straight away command_method = getattr(self.cmds_sync, command) |