summaryrefslogtreecommitdiff
path: root/src/backend/clean.py
blob: 2460d9e3428cf405a50df4dde4098982c5a04b69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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))