summaryrefslogtreecommitdiff
path: root/src/backend/cache.py
blob: ed291f08aff9b1eee7adce30f9a86a1386ee4f43 (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 purge():
    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))