From: Paul Eggleton Date: Tue, 13 Dec 2016 07:07:05 +0000 (+1300) Subject: bitbake: command: provide a means to shut down from the client in memres mode X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e271d7dc606185130e0e47327205bd423490b7c2;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: command: provide a means to shut down from the client in memres mode In memory resident mode we don't really want to actually shut down since it's only the client going away. (Bitbake rev: 74db369c46043116359101cab70486afd82372c0) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index caa3e4d457d..012b35faf6b 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py @@ -472,3 +472,11 @@ class CommandsAsync: command.finishAsyncCommand() resetCooker.needcache = False + def clientComplete(self, command, params): + """ + Do the right thing when the controlling client exits + """ + command.cooker.clientComplete() + command.finishAsyncCommand() + clientComplete.needcache = False + diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 5e5708ee2bb..2614c4485a1 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -1725,6 +1725,13 @@ class BBCooker: def reset(self): self.initConfigurationData() + def clientComplete(self): + """Called when the client is done using the server""" + if self.configuration.server_only: + self.finishcommand() + else: + self.shutdown(True) + def lockBitbake(self): if not hasattr(self, 'lock'): self.lock = None diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 320bb5906c6..c6e958b43cf 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py @@ -146,6 +146,7 @@ class CookerConfiguration(object): self.tracking = False self.interface = [] self.writeeventlog = False + self.server_only = False self.env = {}