diff options
author | Yoann Congal <yoann.congal@smile.fr> | 2024-11-14 23:17:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-18 13:41:38 +0000 |
commit | 30a3ac4a2e81cb13c3113e15b38444490450a70f (patch) | |
tree | ac11c89a4964cb9d1431d8f4f3c4bb2b169c7cf5 /bitbake/lib/bb | |
parent | 2abc5dd0287c12c16fa72e6aa341ebf09a15aef1 (diff) | |
download | poky-30a3ac4a2e81cb13c3113e15b38444490450a70f.tar.gz |
bitbake: tinfoil: add new "finalizeData" API
Create a new tinfoil API "finalizeData" which does key expantion and
runs the anonymous functions to allow bitbake-getvar to have the same
output as "bitbake -e".
(Bitbake rev: 63db64ca98564420a378f14c337074ae06da8c63)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/command.py | 8 | ||||
-rw-r--r-- | bitbake/lib/bb/tinfoil.py | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 695277f1e0..a634276608 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -24,6 +24,7 @@ import io | |||
24 | import bb.event | 24 | import bb.event |
25 | import bb.cooker | 25 | import bb.cooker |
26 | import bb.remotedata | 26 | import bb.remotedata |
27 | import bb.parse | ||
27 | 28 | ||
28 | class DataStoreConnectionHandle(object): | 29 | class DataStoreConnectionHandle(object): |
29 | def __init__(self, dsindex=0): | 30 | def __init__(self, dsindex=0): |
@@ -582,6 +583,13 @@ class CommandsSync: | |||
582 | return DataStoreConnectionHandle(idx) | 583 | return DataStoreConnectionHandle(idx) |
583 | parseRecipeFile.readonly = True | 584 | parseRecipeFile.readonly = True |
584 | 585 | ||
586 | def finalizeData(self, command, params): | ||
587 | newdata = command.cooker.data.createCopy() | ||
588 | bb.data.expandKeys(newdata) | ||
589 | bb.parse.ast.runAnonFuncs(newdata) | ||
590 | idx = command.remotedatastores.store(newdata) | ||
591 | return DataStoreConnectionHandle(idx) | ||
592 | |||
585 | class CommandsAsync: | 593 | class CommandsAsync: |
586 | """ | 594 | """ |
587 | A class of asynchronous commands | 595 | A class of asynchronous commands |
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index dcd3910cc4..0e937fba36 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
@@ -633,6 +633,12 @@ class Tinfoil: | |||
633 | fn = self.get_recipe_file(pn) | 633 | fn = self.get_recipe_file(pn) |
634 | return self.parse_recipe_file(fn) | 634 | return self.parse_recipe_file(fn) |
635 | 635 | ||
636 | def finalizeData(self): | ||
637 | """ | ||
638 | Run anonymous functions and expand keys | ||
639 | """ | ||
640 | return self._reconvert_type(self.run_command('finalizeData'), 'DataStoreConnectionHandle') | ||
641 | |||
636 | def parse_recipe_file(self, fn, appends=True, appendlist=None, config_data=None): | 642 | def parse_recipe_file(self, fn, appends=True, appendlist=None, config_data=None): |
637 | """ | 643 | """ |
638 | Parse the specified recipe file (with or without bbappends) | 644 | Parse the specified recipe file (with or without bbappends) |