summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/list-packageconfig-flags.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-08-05 15:48:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-03 23:45:46 +0100
commit5ec6d9ef309b841cdcbf1d14ac678d106d5d888a (patch)
tree0276975aedc0820dff4e28fcf7ddfea67fb6f5e3 /scripts/contrib/list-packageconfig-flags.py
parent55115f90f909d27599c686852e73df321ad1edff (diff)
downloadopenembedded-core-5ec6d9ef309b841cdcbf1d14ac678d106d5d888a.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 ..."). 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-xscripts/contrib/list-packageconfig-flags.py28
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():
options, args = parser.parse_args(sys.argv)
- bbhandler = bb.tinfoil.Tinfoil()
- bbhandler.prepare()
- print("Gathering recipe data...")
- data_dict = get_recipesdata(bbhandler, options.preferred)
-
- if options.listtype == 'flags':
- pkg_dict = collect_pkgs(data_dict)
- flag_dict = collect_flags(pkg_dict)
- display_flags(flag_dict)
- elif options.listtype == 'recipes':
- pkg_dict = collect_pkgs(data_dict)
- display_pkgs(pkg_dict)
- elif options.listtype == 'all':
- display_all(data_dict)
+ with bb.tinfoil.Tinfoil() as bbhandler:
+ bbhandler.prepare()
+ print("Gathering recipe data...")
+ data_dict = get_recipesdata(bbhandler, options.preferred)
+
+ if options.listtype == 'flags':
+ pkg_dict = collect_pkgs(data_dict)
+ flag_dict = collect_flags(pkg_dict)
+ display_flags(flag_dict)
+ elif options.listtype == 'recipes':
+ pkg_dict = collect_pkgs(data_dict)
+ display_pkgs(pkg_dict)
+ elif options.listtype == 'all':
+ display_all(data_dict)
if __name__ == "__main__":
main()