|
@@ -87,31 +87,34 @@ def main():
|
|
|
|
|
|
plugins = []
|
|
|
tinfoil = tinfoil_init(False)
|
|
|
- for path in ([topdir] +
|
|
|
- tinfoil.config_data.getVar('BBPATH', True).split(':')):
|
|
|
- pluginpath = os.path.join(path, 'lib', 'bblayers')
|
|
|
- bb.utils.load_plugins(logger, plugins, pluginpath)
|
|
|
-
|
|
|
- registered = False
|
|
|
- for plugin in plugins:
|
|
|
- if hasattr(plugin, 'register_commands'):
|
|
|
- registered = True
|
|
|
- plugin.register_commands(subparsers)
|
|
|
- if hasattr(plugin, 'tinfoil_init'):
|
|
|
- plugin.tinfoil_init(tinfoil)
|
|
|
-
|
|
|
- if not registered:
|
|
|
- logger.error("No commands registered - missing plugins?")
|
|
|
- sys.exit(1)
|
|
|
-
|
|
|
- args = parser.parse_args(unparsed_args, namespace=global_args)
|
|
|
-
|
|
|
- if getattr(args, 'parserecipes', False):
|
|
|
- tinfoil.config_data.disableTracking()
|
|
|
- tinfoil.parseRecipes()
|
|
|
- tinfoil.config_data.enableTracking()
|
|
|
-
|
|
|
- return args.func(args)
|
|
|
+ try:
|
|
|
+ for path in ([topdir] +
|
|
|
+ tinfoil.config_data.getVar('BBPATH', True).split(':')):
|
|
|
+ pluginpath = os.path.join(path, 'lib', 'bblayers')
|
|
|
+ bb.utils.load_plugins(logger, plugins, pluginpath)
|
|
|
+
|
|
|
+ registered = False
|
|
|
+ for plugin in plugins:
|
|
|
+ if hasattr(plugin, 'register_commands'):
|
|
|
+ registered = True
|
|
|
+ plugin.register_commands(subparsers)
|
|
|
+ if hasattr(plugin, 'tinfoil_init'):
|
|
|
+ plugin.tinfoil_init(tinfoil)
|
|
|
+
|
|
|
+ if not registered:
|
|
|
+ logger.error("No commands registered - missing plugins?")
|
|
|
+ sys.exit(1)
|
|
|
+
|
|
|
+ args = parser.parse_args(unparsed_args, namespace=global_args)
|
|
|
+
|
|
|
+ if getattr(args, 'parserecipes', False):
|
|
|
+ tinfoil.config_data.disableTracking()
|
|
|
+ tinfoil.parseRecipes()
|
|
|
+ tinfoil.config_data.enableTracking()
|
|
|
+
|
|
|
+ return args.func(args)
|
|
|
+ finally:
|
|
|
+ tinfoil.shutdown()
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|