summaryrefslogtreecommitdiff
path: root/src/backend/cache.py
blob: b040323bc0efceeee783be32356df69c3062cfc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python3

import os
import shutil
import sisyphus.filesystem

def clean():
    if os.path.isdir(sisyphus.filesystem.portageCacheDir):
        for files in os.listdir(sisyphus.filesystem.portageCacheDir):
            if os.path.isfile(os.path.join(sisyphus.filesystem.portageCacheDir, files)):
                os.remove(os.path.join(sisyphus.filesystem.portageCacheDir, files))
            else:
                shutil.rmtree(os.path.join(sisyphus.filesystem.portageCacheDir, files))