summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/command.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r--bitbake/lib/bb/command.py91
1 files changed, 25 insertions, 66 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index b38c151b3d..2879950933 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -450,54 +450,38 @@ class CommandsSync:
450 return all_p, best 450 return all_p, best
451 getRuntimeProviders.readonly = True 451 getRuntimeProviders.readonly = True
452 452
453 def dataStoreConnectorFindVar(self, command, params): 453 def dataStoreConnectorCmd(self, command, params):
454 dsindex = params[0] 454 dsindex = params[0]
455 name = params[1] 455 method = params[1]
456 datastore = command.remotedatastores[dsindex] 456 args = params[2]
457 value, overridedata = datastore._findVar(name) 457 kwargs = params[3]
458
459 if value:
460 content = value.get('_content', None)
461 if isinstance(content, bb.data_smart.DataSmart):
462 # Value is a datastore (e.g. BB_ORIGENV) - need to handle this carefully
463 idx = command.remotedatastores.check_store(content, True)
464 return {'_content': DataStoreConnectionHandle(idx),
465 '_connector_origtype': 'DataStoreConnectionHandle',
466 '_connector_overrides': overridedata}
467 elif isinstance(content, set):
468 return {'_content': list(content),
469 '_connector_origtype': 'set',
470 '_connector_overrides': overridedata}
471 else:
472 value['_connector_overrides'] = overridedata
473 else:
474 value = {}
475 value['_connector_overrides'] = overridedata
476 return value
477 dataStoreConnectorFindVar.readonly = True
478 458
479 def dataStoreConnectorGetKeys(self, command, params): 459 d = command.remotedatastores[dsindex]
480 dsindex = params[0] 460 ret = getattr(d, method)(*args, **kwargs)
481 datastore = command.remotedatastores[dsindex] 461
482 return list(datastore.keys()) 462 if isinstance(ret, bb.data_smart.DataSmart):
483 dataStoreConnectorGetKeys.readonly = True 463 idx = command.remotedatastores.store(ret)
464 return DataStoreConnectionHandle(idx)
484 465
485 def dataStoreConnectorGetVarHistory(self, command, params): 466 return ret
467
468 def dataStoreConnectorVarHistCmd(self, command, params):
486 dsindex = params[0] 469 dsindex = params[0]
487 name = params[1] 470 method = params[1]
488 datastore = command.remotedatastores[dsindex] 471 args = params[2]
489 return datastore.varhistory.variable(name) 472 kwargs = params[3]
490 dataStoreConnectorGetVarHistory.readonly = True
491 473
492 def dataStoreConnectorExpandPythonRef(self, command, params): 474 d = command.remotedatastores[dsindex].varhistory
493 config_data_dict = params[0] 475 return getattr(d, method)(*args, **kwargs)
494 varname = params[1]
495 expr = params[2]
496 476
497 config_data = command.remotedatastores.receive_datastore(config_data_dict) 477 def dataStoreConnectorIncHistCmd(self, command, params):
478 dsindex = params[0]
479 method = params[1]
480 args = params[2]
481 kwargs = params[3]
498 482
499 varparse = bb.data_smart.VariableParse(varname, config_data) 483 d = command.remotedatastores[dsindex].inchistory
500 return varparse.python_sub(expr) 484 return getattr(d, method)(*args, **kwargs)
501 485
502 def dataStoreConnectorRelease(self, command, params): 486 def dataStoreConnectorRelease(self, command, params):
503 dsindex = params[0] 487 dsindex = params[0]
@@ -505,31 +489,6 @@ class CommandsSync:
505 raise CommandError('dataStoreConnectorRelease: invalid index %d' % dsindex) 489 raise CommandError('dataStoreConnectorRelease: invalid index %d' % dsindex)
506 command.remotedatastores.release(dsindex) 490 command.remotedatastores.release(dsindex)
507 491
508 def dataStoreConnectorSetVarFlag(self, command, params):
509 dsindex = params[0]
510 name = params[1]
511 flag = params[2]
512 value = params[3]
513 datastore = command.remotedatastores[dsindex]
514 datastore.setVarFlag(name, flag, value)
515
516 def dataStoreConnectorDelVar(self, command, params):
517 dsindex = params[0]
518 name = params[1]
519 datastore = command.remotedatastores[dsindex]
520 if len(params) > 2:
521 flag = params[2]
522 datastore.delVarFlag(name, flag)
523 else:
524 datastore.delVar(name)
525
526 def dataStoreConnectorRenameVar(self, command, params):
527 dsindex = params[0]
528 name = params[1]
529 newname = params[2]
530 datastore = command.remotedatastores[dsindex]
531 datastore.renameVar(name, newname)
532
533 def parseRecipeFile(self, command, params): 492 def parseRecipeFile(self, command, params):
534 """ 493 """
535 Parse the specified recipe file (with or without bbappends) 494 Parse the specified recipe file (with or without bbappends)