summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-07-05 03:07:34 +0000
committerZac Medico <zmedico@gentoo.org>2006-07-05 03:07:34 +0000
commit1a51b31719549f1b0b2cce421fc6e927721274da (patch)
treeea54cd31b7aa8fc97b5c1ffa6c3cb2f7e4b54e33
parent154be9835bef23e69dd08c7fb79a1affb4e9ee6b (diff)
downloadportage-1a51b31719549f1b0b2cce421fc6e927721274da.tar.gz
portage-1a51b31719549f1b0b2cce421fc6e927721274da.tar.bz2
portage-1a51b31719549f1b0b2cce421fc6e927721274da.zip
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
-rwxr-xr-xbin/emerge8
1 files 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