aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/command.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-24 14:57:01 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-24 17:48:12 +0100
commit3caa43b665604475d2c87ba505efb0b9fca9c2e9 (patch)
tree26e05c7017d6ff25193193341ea0631d7eda4dd1 /lib/bb/command.py
parentf7d2c9116116659ea42260a3bb96dca100aadae7 (diff)
downloadbitbake-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.py9
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)