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.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 6abf38668b..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
@@ -74,8 +75,12 @@ class Command:
74 result = command_method(self, commandline) 75 result = command_method(self, commandline)
75 except CommandError as exc: 76 except CommandError as exc:
76 return None, exc.args[0] 77 return None, exc.args[0]
77 except (Exception, SystemExit): 78 except (Exception, SystemExit) as exc:
78 import traceback 79 import traceback
80 if isinstance(exc, bb.BBHandledException):
81 # We need to start returning real exceptions here. Until we do, we can't
82 # tell if an exception is an instance of bb.BBHandledException
83 return None, "bb.BBHandledException()\n" + traceback.format_exc()
79 return None, traceback.format_exc() 84 return None, traceback.format_exc()
80 else: 85 else:
81 return result, None 86 return result, None
@@ -474,6 +479,17 @@ class CommandsSync:
474 d = command.remotedatastores[dsindex].varhistory 479 d = command.remotedatastores[dsindex].varhistory
475 return getattr(d, method)(*args, **kwargs) 480 return getattr(d, method)(*args, **kwargs)
476 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
477 def dataStoreConnectorIncHistCmd(self, command, params): 493 def dataStoreConnectorIncHistCmd(self, command, params):
478 dsindex = params[0] 494 dsindex = params[0]
479 method = params[1] 495 method = params[1]
@@ -620,6 +636,16 @@ class CommandsAsync:
620 command.finishAsyncCommand() 636 command.finishAsyncCommand()
621 findFilesMatchingInDir.needcache = False 637 findFilesMatchingInDir.needcache = False
622 638
639 def testCookerCommandEvent(self, command, params):
640 """
641 Dummy command used by OEQA selftest to test tinfoil without IO
642 """
643 pattern = params[0]
644
645 command.cooker.testCookerCommandEvent(pattern)
646 command.finishAsyncCommand()
647 testCookerCommandEvent.needcache = False
648
623 def findConfigFilePath(self, command, params): 649 def findConfigFilePath(self, command, params):
624 """ 650 """
625 Find the path of the requested configuration file 651 Find the path of the requested configuration file