diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-12-13 20:07:08 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-14 12:25:07 +0000 |
commit | f1f3a112a02aef2e7094b4700c9a7d341ee01275 (patch) | |
tree | 25a577d27671a21492f60a4dafdc88138116e02f /bitbake/lib/bb/command.py | |
parent | 8c33063a1de7234e681675ee45ec7a376c84cefe (diff) | |
download | poky-f1f3a112a02aef2e7094b4700c9a7d341ee01275.tar.gz |
bitbake: tinfoil: implement server-side recipe parsing
It's not really practical for us to parse recipes on the client side, we
need to do it on the server because that's where we have the full python
environment (including any "pure" python functions defined in classes).
Thus, add some functions to tinfoil do this including a few shortcut
functions.
(Bitbake rev: 8f635815d191c9d848a92d51fdbf5e9fd3da1727)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r-- | bitbake/lib/bb/command.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index d5be86dab8..b296b8ce84 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -493,6 +493,50 @@ class CommandsSync: | |||
493 | varparse = bb.data_smart.VariableParse(varname, datastore) | 493 | varparse = bb.data_smart.VariableParse(varname, datastore) |
494 | return varparse.python_sub(expr) | 494 | return varparse.python_sub(expr) |
495 | 495 | ||
496 | def dataStoreConnectorRelease(self, command, params): | ||
497 | dsindex = params[0] | ||
498 | if dsindex <= 0: | ||
499 | raise CommandError('dataStoreConnectorRelease: invalid index %d' % dsindex) | ||
500 | command.remotedatastores.release(dsindex) | ||
501 | |||
502 | def parseRecipeFile(self, command, params): | ||
503 | """ | ||
504 | Parse the specified recipe file (with or without bbappends) | ||
505 | and return a datastore object representing the environment | ||
506 | for the recipe. | ||
507 | """ | ||
508 | fn = params[0] | ||
509 | appends = params[1] | ||
510 | appendlist = params[2] | ||
511 | if len(params) > 3: | ||
512 | config_data_dict = params[3] | ||
513 | config_data = command.remotedatastores.receive_datastore(config_data_dict) | ||
514 | else: | ||
515 | config_data = None | ||
516 | |||
517 | if appends: | ||
518 | if appendlist is not None: | ||
519 | appendfiles = appendlist | ||
520 | else: | ||
521 | appendfiles = command.cooker.collection.get_file_appends(fn) | ||
522 | else: | ||
523 | appendfiles = [] | ||
524 | # We are calling bb.cache locally here rather than on the server, | ||
525 | # but that's OK because it doesn't actually need anything from | ||
526 | # the server barring the global datastore (which we have a remote | ||
527 | # version of) | ||
528 | if config_data: | ||
529 | # We have to use a different function here if we're passing in a datastore | ||
530 | # NOTE: we took a copy above, so we don't do it here again | ||
531 | envdata = bb.cache.parse_recipe(config_data, fn, appendfiles)[''] | ||
532 | else: | ||
533 | # Use the standard path | ||
534 | parser = bb.cache.NoCache(command.cooker.databuilder) | ||
535 | envdata = parser.loadDataFull(fn, appendfiles) | ||
536 | idx = command.remotedatastores.store(envdata) | ||
537 | return DataStoreConnectionHandle(idx) | ||
538 | parseRecipeFile.readonly = True | ||
539 | |||
496 | class CommandsAsync: | 540 | class CommandsAsync: |
497 | """ | 541 | """ |
498 | A class of asynchronous commands | 542 | A class of asynchronous commands |