[gnome-continuous-yocto/gnomeostree-3.28-rocko: 2132/8267] bitbake: bitbake-diffsigs/bitbake-layers: Ensure tinfoil is shut down correctly
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 2132/8267] bitbake: bitbake-diffsigs/bitbake-layers: Ensure tinfoil is shut down correctly
- Date: Sat, 16 Dec 2017 22:48:03 +0000 (UTC)
commit f551e67fa79810ac82d5a226a328b8d79ba725fe
Author: Paul Eggleton <paul eggleton linux intel com>
Date: Wed Aug 5 15:47:12 2015 +0100
bitbake: bitbake-diffsigs/bitbake-layers: Ensure tinfoil is shut down correctly
We should always shut down tinfoil when we're finished with it, either
by explicitly calling the shutdown() method or by using it as a
context manager ("with ...").
(Bitbake rev: 131e6dc4bbd197774d35d2b266bfb0816f6e6b1e)
Signed-off-by: Paul Eggleton <paul eggleton linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
bitbake/bin/bitbake-diffsigs | 6 ++--
bitbake/bin/bitbake-layers | 53 ++++++++++++++++++++++-------------------
2 files changed, 31 insertions(+), 28 deletions(-)
---
diff --git a/bitbake/bin/bitbake-diffsigs b/bitbake/bin/bitbake-diffsigs
index 3b6ef88..527d2c7 100755
--- a/bitbake/bin/bitbake-diffsigs
+++ b/bitbake/bin/bitbake-diffsigs
@@ -115,9 +115,9 @@ parser.add_option("-t", "--task",
options, args = parser.parse_args(sys.argv)
if options.taskargs:
- tinfoil = bb.tinfoil.Tinfoil()
- tinfoil.prepare(config_only = True)
- find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1])
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1])
else:
if len(args) == 1:
parser.print_help()
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index 0c973df..946def2 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -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__":
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]