summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/clear_caches.py
blob: cd43d915d058899e57b4c12b8790a0e8b7039caa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

import gc
import portage

def clear_caches(trees):
	for d in trees.values():
		d["porttree"].dbapi.melt()
		d["porttree"].dbapi._aux_cache.clear()
		d["bintree"].dbapi._aux_cache.clear()
		d["bintree"].dbapi._clear_cache()
	portage.dircache.clear()
	gc.collect()