]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: cookerdata/cooker: Restore original datastore upon client disconnect
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 18 Jul 2017 16:50:24 +0000 (17:50 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 21 Jul 2017 07:41:11 +0000 (08:41 +0100)
(Bitbake rev: 67ae612ab890965357d24a9bd35610cf813b79ba)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/cooker.py
bitbake/lib/bb/cookerdata.py

index e27763ecab166513aa9b93a0d5a308512dd5a0c1..daffe67540c39108c984a3bb8f5387991b7e8ef2 100644 (file)
@@ -1566,6 +1566,8 @@ class BBCooker:
     def clientComplete(self):
         """Called when the client is done using the server"""
         self.finishcommand()
+        self.databuilder.reset()
+        self.data = self.databuilder.data
 
 def server_main(cooker, func, *args):
     cooker.pre_serve()
index d05abfe74527cc99c63686c23a3812d9e39453f0..55c6ea83cbcfca721e2f19bda7b8d99e4dfac4ff 100644 (file)
@@ -328,6 +328,15 @@ class CookerDataBuilder(object):
             logger.exception("Error parsing configuration files")
             raise bb.BBHandledException
 
+        # Create a copy so we can reset at a later date when UIs disconnect
+        self.origdata = self.data
+        self.data = bb.data.createCopy(self.origdata)
+        self.mcdata[''] = self.data
+
+    def reset(self):
+        self.data = bb.data.createCopy(self.origdata)
+        self.mcdata[''] = self.data
+
     def _findLayerConf(self, data):
         return findConfigFile("bblayers.conf", data)