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

import animation
import os
import shutil
import subprocess
import sisyphus.filesystem

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