From 1a51b31719549f1b0b2cce421fc6e927721274da Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 5 Jul 2006 03:07:34 +0000 Subject: [PATCH] Pass existing trees into load_emerge_config() so that the existing portdbapi instances will be cleaned up by portage.create_trees(). svn path=/main/trunk/; revision=3786 --- bin/emerge | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/emerge b/bin/emerge index 5259a729e..610ec50f8 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2840,7 +2840,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): updatecache_flg = False # Reload the whole config from scratch. - settings, trees, mtimedb = load_emerge_config() + settings, trees, mtimedb = load_emerge_config(trees=trees) portdb = trees[settings["ROOT"]]["porttree"].dbapi if os.path.exists(myportdir+"/metadata/cache") and updatecache_flg: @@ -2850,7 +2850,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): settings, trees, mtimedb["updates"]) mtimedb.commit() # Reload the whole config from scratch. - settings, trees, mtimedb = load_emerge_config() + settings, trees, mtimedb = load_emerge_config(trees=trees) portdb = trees[settings["ROOT"]]["porttree"].dbapi mybestpv = portdb.xmatch("bestmatch-visible", "sys-apps/portage") @@ -3519,11 +3519,11 @@ def parse_opts(tmpcmdline): return myaction, myopts, myfiles -def load_emerge_config(): +def load_emerge_config(trees=None): kwargs = {} for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT")): kwargs[k] = os.environ.get(envvar, "/") - trees = portage.create_trees(**kwargs) + trees = portage.create_trees(trees=trees, **kwargs) settings = trees["/"]["vartree"].settings -- 2.26.2