except KeyboardInterrupt:
sys.exit(1)
+import gc
import os, stat
os.environ["PORTAGE_LEGACY_GLOBALS"] = "false"
time.sleep(3) # allow the parent to have first fetch
mymergelist = mydepgraph.altlist()
del mydepgraph
+ clear_caches(trees)
+
retval = mergetask.merge(mymergelist, favorites, mtimedb)
merge_count = mergetask.curval
else:
pkglist = mydepgraph.altlist()
mydepgraph.saveNomergeFavorites()
del mydepgraph
+ clear_caches(trees)
+
mergetask = MergeTask(settings, trees, myopts)
retval = mergetask.merge(pkglist, favorites, mtimedb)
merge_count = mergetask.curval
settings = trees[myroot]["vartree"].settings
settings.validate()
+def clear_caches(trees):
+ for d in trees.itervalues():
+ d["porttree"].dbapi.melt()
+ d["porttree"].dbapi._aux_cache.clear()
+ d["bintree"].dbapi._aux_cache.clear()
+ d["bintree"].dbapi._clear_cache()
+ gc.collect()
+
def load_emerge_config(trees=None):
kwargs = {}
for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT")):