summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake-layers
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-08-05 15:47:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-02 18:09:48 +0100
commitf551e67fa79810ac82d5a226a328b8d79ba725fe (patch)
treedd3b3b595ae5588cec74767350ed4ce4801f709b /bitbake/bin/bitbake-layers
parent8f277fcf338cbbb191e4f1ccd547c52ef5f8a107 (diff)
downloadpoky-f551e67fa79810ac82d5a226a328b8d79ba725fe.tar.gz
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>
Diffstat (limited to 'bitbake/bin/bitbake-layers')
-rwxr-xr-xbitbake/bin/bitbake-layers53
1 files changed, 28 insertions, 25 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index 0c973dfd2f..946def220c 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -87,31 +87,34 @@ def main():
87 87
88 plugins = [] 88 plugins = []
89 tinfoil = tinfoil_init(False) 89 tinfoil = tinfoil_init(False)
90 for path in ([topdir] + 90 try:
91 tinfoil.config_data.getVar('BBPATH', True).split(':')): 91 for path in ([topdir] +
92 pluginpath = os.path.join(path, 'lib', 'bblayers') 92 tinfoil.config_data.getVar('BBPATH', True).split(':')):
93 bb.utils.load_plugins(logger, plugins, pluginpath) 93 pluginpath = os.path.join(path, 'lib', 'bblayers')
94 94 bb.utils.load_plugins(logger, plugins, pluginpath)
95 registered = False 95
96 for plugin in plugins: 96 registered = False
97 if hasattr(plugin, 'register_commands'): 97 for plugin in plugins:
98 registered = True 98 if hasattr(plugin, 'register_commands'):
99 plugin.register_commands(subparsers) 99 registered = True
100 if hasattr(plugin, 'tinfoil_init'): 100 plugin.register_commands(subparsers)
101 plugin.tinfoil_init(tinfoil) 101 if hasattr(plugin, 'tinfoil_init'):
102 102 plugin.tinfoil_init(tinfoil)
103 if not registered: 103
104 logger.error("No commands registered - missing plugins?") 104 if not registered:
105 sys.exit(1) 105 logger.error("No commands registered - missing plugins?")
106 106 sys.exit(1)
107 args = parser.parse_args(unparsed_args, namespace=global_args) 107
108 108 args = parser.parse_args(unparsed_args, namespace=global_args)
109 if getattr(args, 'parserecipes', False): 109
110 tinfoil.config_data.disableTracking() 110 if getattr(args, 'parserecipes', False):
111 tinfoil.parseRecipes() 111 tinfoil.config_data.disableTracking()
112 tinfoil.config_data.enableTracking() 112 tinfoil.parseRecipes()
113 113 tinfoil.config_data.enableTracking()
114 return args.func(args) 114
115 return args.func(args)
116 finally:
117 tinfoil.shutdown()
115 118
116 119
117if __name__ == "__main__": 120if __name__ == "__main__":