diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-08-05 15:48:00 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-03 23:45:54 +0100 |
commit | e616beba1c85e31246d1c798191b194d168b3489 (patch) | |
tree | 5b9d19e7c4a7caeb72f1bb9da4a2b221cfb1da96 /scripts/contrib/list-packageconfig-flags.py | |
parent | f2854c67ce963211f27223bd1194420621694bc2 (diff) | |
download | poky-e616beba1c85e31246d1c798191b194d168b3489.tar.gz |
scripts: 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 ...").
(From OE-Core rev: 5ec6d9ef309b841cdcbf1d14ac678d106d5d888a)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/list-packageconfig-flags.py')
-rwxr-xr-x | scripts/contrib/list-packageconfig-flags.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/scripts/contrib/list-packageconfig-flags.py b/scripts/contrib/list-packageconfig-flags.py index 9090935e0f..389fb97f67 100755 --- a/scripts/contrib/list-packageconfig-flags.py +++ b/scripts/contrib/list-packageconfig-flags.py | |||
@@ -159,20 +159,20 @@ def main(): | |||
159 | 159 | ||
160 | options, args = parser.parse_args(sys.argv) | 160 | options, args = parser.parse_args(sys.argv) |
161 | 161 | ||
162 | bbhandler = bb.tinfoil.Tinfoil() | 162 | with bb.tinfoil.Tinfoil() as bbhandler: |
163 | bbhandler.prepare() | 163 | bbhandler.prepare() |
164 | print("Gathering recipe data...") | 164 | print("Gathering recipe data...") |
165 | data_dict = get_recipesdata(bbhandler, options.preferred) | 165 | data_dict = get_recipesdata(bbhandler, options.preferred) |
166 | 166 | ||
167 | if options.listtype == 'flags': | 167 | if options.listtype == 'flags': |
168 | pkg_dict = collect_pkgs(data_dict) | 168 | pkg_dict = collect_pkgs(data_dict) |
169 | flag_dict = collect_flags(pkg_dict) | 169 | flag_dict = collect_flags(pkg_dict) |
170 | display_flags(flag_dict) | 170 | display_flags(flag_dict) |
171 | elif options.listtype == 'recipes': | 171 | elif options.listtype == 'recipes': |
172 | pkg_dict = collect_pkgs(data_dict) | 172 | pkg_dict = collect_pkgs(data_dict) |
173 | display_pkgs(pkg_dict) | 173 | display_pkgs(pkg_dict) |
174 | elif options.listtype == 'all': | 174 | elif options.listtype == 'all': |
175 | display_all(data_dict) | 175 | display_all(data_dict) |
176 | 176 | ||
177 | if __name__ == "__main__": | 177 | if __name__ == "__main__": |
178 | main() | 178 | main() |