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