diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-06-06 16:22:04 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-06-06 16:22:04 +0100 |
commit | ac0efd1bd6c703147bd8d3caedf489fab87d6131 (patch) | |
tree | e6af981b6e90be35447dbb88dd276a4d8ff2d47e /src/backend/clean.py | |
parent | 49e6ab19aa461151132dfb4f1cf962d4ef403c66 (diff) |
big rewrite : split the backend in smaller pieces, rework the cli frontend to work with the new backend ... gui frontend wip
Diffstat (limited to 'src/backend/clean.py')
-rw-r--r-- | src/backend/clean.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/backend/clean.py b/src/backend/clean.py new file mode 100644 index 0000000..2460d9e --- /dev/null +++ b/src/backend/clean.py @@ -0,0 +1,13 @@ +#!/usr/bin/python3 + +import os + +portageCacheDir = '/var/cache/packages' + +def cache(): + 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)) |