summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-16 15:45:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-26 12:14:22 +0100
commit6d1f8412becc907af7741ab547d233a10d66ee14 (patch)
tree482ed89c52b7405d2a6025029e2a79a4bf90feeb /bitbake
parent872caf23addf095418bbe39eff7ca5d0211fb82d (diff)
downloadpoky-6d1f8412becc907af7741ab547d233a10d66ee14.tar.gz
bitbake: tinfoil/data_smart: Allow variable history emit() to function remotely
We can't access the emit() function of varhistory currently as the datastore parameter isn't handled correctly, nor is the output stream. Add a custom wrapper for this function which handles the two details correctly. (Bitbake rev: 144a1cfe8b60c677bb6ec66c242e064c7ba3ed88) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ba0fa084ccd2b1ade96425d158fd31e49e42f286) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/command.py12
-rw-r--r--bitbake/lib/bb/tinfoil.py4
2 files changed, 16 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 98c945edb5..b8429b2773 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -20,6 +20,7 @@ Commands are queued in a CommandQueue
20 20
21from collections import OrderedDict, defaultdict 21from collections import OrderedDict, defaultdict
22 22
23import io
23import bb.event 24import bb.event
24import bb.cooker 25import bb.cooker
25import bb.remotedata 26import bb.remotedata
@@ -478,6 +479,17 @@ class CommandsSync:
478 d = command.remotedatastores[dsindex].varhistory 479 d = command.remotedatastores[dsindex].varhistory
479 return getattr(d, method)(*args, **kwargs) 480 return getattr(d, method)(*args, **kwargs)
480 481
482 def dataStoreConnectorVarHistCmdEmit(self, command, params):
483 dsindex = params[0]
484 var = params[1]
485 oval = params[2]
486 val = params[3]
487 d = command.remotedatastores[params[4]]
488
489 o = io.StringIO()
490 command.remotedatastores[dsindex].varhistory.emit(var, oval, val, o, d)
491 return o.getvalue()
492
481 def dataStoreConnectorIncHistCmd(self, command, params): 493 def dataStoreConnectorIncHistCmd(self, command, params):
482 dsindex = params[0] 494 dsindex = params[0]
483 method = params[1] 495 method = params[1]
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index 28f1e5623f..8bec8cbaf6 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -53,6 +53,10 @@ class TinfoilDataStoreConnectorVarHistory:
53 def remoteCommand(self, cmd, *args, **kwargs): 53 def remoteCommand(self, cmd, *args, **kwargs):
54 return self.tinfoil.run_command('dataStoreConnectorVarHistCmd', self.dsindex, cmd, args, kwargs) 54 return self.tinfoil.run_command('dataStoreConnectorVarHistCmd', self.dsindex, cmd, args, kwargs)
55 55
56 def emit(self, var, oval, val, o, d):
57 ret = self.tinfoil.run_command('dataStoreConnectorVarHistCmdEmit', self.dsindex, var, oval, val, d.dsindex)
58 o.write(ret)
59
56 def __getattr__(self, name): 60 def __getattr__(self, name):
57 if not hasattr(bb.data_smart.VariableHistory, name): 61 if not hasattr(bb.data_smart.VariableHistory, name):
58 raise AttributeError("VariableHistory has no such method %s" % name) 62 raise AttributeError("VariableHistory has no such method %s" % name)