* implement a command called delete-cache

This commit is contained in:
Eray Özkural
2005-10-09 23:42:27 +00:00
parent 770b704df3
commit ecc99126fe
2 changed files with 18 additions and 0 deletions
+5
View File
@@ -641,3 +641,8 @@ def build_until(pspecfile, state, authInfo=None):
return return
__buildState_buildpackages(pb, last) __buildState_buildpackages(pb, last)
def delete_cache():
util.clean_dir(ctx.config.packages_dir())
util.clean_dir(ctx.config.archives_dir())
util.clean_dir(ctx.config.tmp_dir())
+13
View File
@@ -214,6 +214,19 @@ class Clean(Command):
pisi.util.clean_locks() pisi.util.clean_locks()
self.finalize() self.finalize()
class DeleteCache(Command):
"""Clean stale locks."""
__metaclass__ = autocommand
def __init__(self):
super(DeleteCache, self).__init__()
name = ("delete-cache", None)
def run(self):
self.init(database=False)
pisi.api.delete_cache()
class Graph(Command): class Graph(Command):
"""Graph package relations. """Graph package relations.