diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-04-16 15:45:06 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-04-18 11:38:22 +0100 |
commit | d08d362cf98e9f3b6e99f4f9e33638e1fceffbaf (patch) | |
tree | 9f1000d312e26dd697e8e5a753932462f02cb290 /bitbake | |
parent | 46654e14a50c4c74512687df164fe014e9794055 (diff) | |
download | poky-d08d362cf98e9f3b6e99f4f9e33638e1fceffbaf.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: ba0fa084ccd2b1ade96425d158fd31e49e42f286)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/command.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bb/tinfoil.py | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index dd77cdd6e2..f530cf844b 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 | ||
21 | from collections import OrderedDict, defaultdict | 21 | from collections import OrderedDict, defaultdict |
22 | 22 | ||
23 | import io | ||
23 | import bb.event | 24 | import bb.event |
24 | import bb.cooker | 25 | import bb.cooker |
25 | import bb.remotedata | 26 | import bb.remotedata |
@@ -500,6 +501,17 @@ class CommandsSync: | |||
500 | d = command.remotedatastores[dsindex].varhistory | 501 | d = command.remotedatastores[dsindex].varhistory |
501 | return getattr(d, method)(*args, **kwargs) | 502 | return getattr(d, method)(*args, **kwargs) |
502 | 503 | ||
504 | def dataStoreConnectorVarHistCmdEmit(self, command, params): | ||
505 | dsindex = params[0] | ||
506 | var = params[1] | ||
507 | oval = params[2] | ||
508 | val = params[3] | ||
509 | d = command.remotedatastores[params[4]] | ||
510 | |||
511 | o = io.StringIO() | ||
512 | command.remotedatastores[dsindex].varhistory.emit(var, oval, val, o, d) | ||
513 | return o.getvalue() | ||
514 | |||
503 | def dataStoreConnectorIncHistCmd(self, command, params): | 515 | def dataStoreConnectorIncHistCmd(self, command, params): |
504 | dsindex = params[0] | 516 | dsindex = params[0] |
505 | method = params[1] | 517 | method = params[1] |
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index 796a98f053..27a341541a 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
@@ -52,6 +52,10 @@ class TinfoilDataStoreConnectorVarHistory: | |||
52 | def remoteCommand(self, cmd, *args, **kwargs): | 52 | def remoteCommand(self, cmd, *args, **kwargs): |
53 | return self.tinfoil.run_command('dataStoreConnectorVarHistCmd', self.dsindex, cmd, args, kwargs) | 53 | return self.tinfoil.run_command('dataStoreConnectorVarHistCmd', self.dsindex, cmd, args, kwargs) |
54 | 54 | ||
55 | def emit(self, var, oval, val, o, d): | ||
56 | ret = self.tinfoil.run_command('dataStoreConnectorVarHistCmdEmit', self.dsindex, var, oval, val, d.dsindex) | ||
57 | o.write(ret) | ||
58 | |||
55 | def __getattr__(self, name): | 59 | def __getattr__(self, name): |
56 | if not hasattr(bb.data_smart.VariableHistory, name): | 60 | if not hasattr(bb.data_smart.VariableHistory, name): |
57 | raise AttributeError("VariableHistory has no such method %s" % name) | 61 | raise AttributeError("VariableHistory has no such method %s" % name) |