summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-02-02 16:29:21 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-19 06:28:47 -0800
commit10968b4266a74f2f55e66368784e9b9c2aa4f592 (patch)
treee991929b668c20777bc3db293d2352580b8b3d78 /bitbake/bin
parent157d9d92a026db96eb7388a719aa800d2f5bbe2d (diff)
downloadpoky-10968b4266a74f2f55e66368784e9b9c2aa4f592.tar.gz
bitbake: bitbake-layers: Handle exception raised bytinfoil.prepare()
The tinfoil.prepare method can raise Exceptions when is parsing initial data so add this call inside try, finally to avoid get blocked for don't call tinfoil.shutdown(). The tinfoil_init function was remove because isn't make sense now since tinfoil.prepare() needs to be inside try, finally closures. Example of raised exception and gets blocked: $ bitbake-layers add-layer ~/repos/meta-openembedded/meta-python/ Traceback (most recent call last): File "/home/alimon/repos/poky/bitbake/bin/bitbake-layers", line 83, in main tinfoil.prepare(True) ... File "/home/alimon/repos/poky/bitbake/lib/bb/tinfoil.py", line 268, in run_command raise TinfoilCommandFailed(result[1]) bb.tinfoil.TinfoilCommandFailed: Traceback (most recent call last): File "/home/alimon/repos/poky/bitbake/lib/bb/command.py", line 81, in runCommand result = command_method(self, commandline) ... File "/home/alimon/repos/poky/bitbake/lib/bb/cooker.py", line 1314, in handleCollections raise CollectionError("Errors during parsing layer configuration") bb.cooker.CollectionError: Errors during parsing layer configuration (Bitbake rev: 61ebe9a026652e32f9482f66fc3fe7a8672fc093) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/bitbake-layers13
1 files changed, 3 insertions, 10 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index 1e2cfbcac1..66fc7ca21f 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -31,15 +31,6 @@ sys.path[0:0] = [os.path.join(topdir, 'lib')]
31 31
32import bb.tinfoil 32import bb.tinfoil
33 33
34
35def tinfoil_init(parserecipes):
36 import bb.tinfoil
37 tinfoil = bb.tinfoil.Tinfoil(tracking=True)
38 tinfoil.prepare(not parserecipes)
39 tinfoil.logger.setLevel(logger.getEffectiveLevel())
40 return tinfoil
41
42
43def logger_create(name, output=sys.stderr): 34def logger_create(name, output=sys.stderr):
44 logger = logging.getLogger(name) 35 logger = logging.getLogger(name)
45 loggerhandler = logging.StreamHandler(output) 36 loggerhandler = logging.StreamHandler(output)
@@ -86,8 +77,10 @@ def main():
86 logger_setup_color(logger, global_args.color) 77 logger_setup_color(logger, global_args.color)
87 78
88 plugins = [] 79 plugins = []
89 tinfoil = tinfoil_init(False) 80 tinfoil = bb.tinfoil.Tinfoil(tracking=True)
81 tinfoil.logger.setLevel(logger.getEffectiveLevel())
90 try: 82 try:
83 tinfoil.prepare(True)
91 for path in ([topdir] + 84 for path in ([topdir] +
92 tinfoil.config_data.getVar('BBPATH').split(':')): 85 tinfoil.config_data.getVar('BBPATH').split(':')):
93 pluginpath = os.path.join(path, 'lib', 'bblayers') 86 pluginpath = os.path.join(path, 'lib', 'bblayers')