pisi dc to remove db caches

This commit is contained in:
Faik Uygur
2009-04-08 08:14:18 +00:00
parent 2e925e4ccd
commit 7c45f62c3b
3 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -428,11 +428,13 @@ def get_takeback_plan(operation):
@locked
def delete_cache():
"""
Deletes cached packages, cached archives, build dirs
Deletes cached packages, cached archives, build dirs, db caches
"""
pisi.util.clean_dir(ctx.config.cached_packages_dir())
pisi.util.clean_dir(ctx.config.archives_dir())
pisi.util.clean_dir(ctx.config.tmp_dir())
for cache in filter(lambda x: x.endswith(".cache"), os.listdir(ctx.config.cache_root_dir()))
os.unlink(pisi.util.join_path(ctx.config.cache_root_dir(), cache))
@locked
def snapshot():
+3
View File
@@ -107,6 +107,9 @@ class Config(object):
def archives_dir(self):
return self.subdir(self.values.dirs.archives_dir)
def cache_root_dir(self):
return self.subdir(self.values.dirs.cache_root_dir)
def cached_packages_dir(self):
return self.subdir(self.values.dirs.cached_packages_dir)
+1
View File
@@ -98,6 +98,7 @@ class DirectoriesDefaults:
info_dir = "/var/lib/pisi/info"
history_dir = "/var/lib/pisi/history"
archives_dir = "/var/cache/pisi/archives"
cache_root_dir = "/var/cache/pisi"
cached_packages_dir = "/var/cache/pisi/packages"
compiled_packages_dir = "/var/cache/pisi/packages"
debug_packages_dir = "/var/cache/pisi/packages-debug"