diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-08-05 15:48:00 +0100 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-09-01 07:48:52 +1200 |
commit | 62c4df62df0b96f8dc4d3ddb37a3b3bfe9cc54a6 (patch) | |
tree | fbe787e2fc9e554fe0eacf06c5868e63ce7a6fec /scripts/contrib/list-packageconfig-flags.py | |
parent | e2adf2542c28268aa3ad9329e32e01fb50b502b4 (diff) | |
download | openembedded-core-contrib-paule/tinfoil-fixes-oe.tar.gz |
scripts: ensure tinfoil is shut down correctlypaule/tinfoil-fixes-oe
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>
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(): 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() |