summaryrefslogtreecommitdiff
path: root/src/backend/cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/cache.py')
-rw-r--r--src/backend/cache.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/backend/cache.py b/src/backend/cache.py
new file mode 100644
index 0000000..aaa0a32
--- /dev/null
+++ b/src/backend/cache.py
@@ -0,0 +1,14 @@
+#!/usr/bin/python3
+
+import os
+import shutil
+
+portageCacheDir = '/var/cache/packages'
+
+def clean():
+ if os.path.isdir(portageCacheDir):
+ for files in os.listdir(portageCacheDir):
+ if os.path.isfile(os.path.join(portageCacheDir, files)):
+ os.remove(os.path.join(portageCacheDir, files))
+ else:
+ shutil.rmtree(os.path.join(portageCacheDir, files))