summaryrefslogtreecommitdiff
path: root/src/backend/metadata.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/metadata.py')
-rw-r--r--src/backend/metadata.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/backend/metadata.py b/src/backend/metadata.py
index fc30b15..a27e06a 100644
--- a/src/backend/metadata.py
+++ b/src/backend/metadata.py
@@ -4,16 +4,15 @@ import animation
import os
import shutil
import subprocess
-
-portageMetadataDir = '/var/cache/edb'
+import sisyphus.filesystem
def regenSilent():
- if os.path.isdir(portageMetadataDir):
- for files in os.listdir(portageMetadataDir):
- if os.path.isfile(os.path.join(portageMetadataDir, files)):
- os.remove(os.path.join(portageMetadataDir, files))
+ 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(portageMetadataDir, files))
+ shutil.rmtree(os.path.join(sisyphus.filesystem.portageMetadataDir, files))
portageExecStage1 = subprocess.Popen(['emerge', '--quiet', '--regen'], stdout=subprocess.PIPE)
portageExecStage1.wait()
@@ -22,12 +21,12 @@ def regenSilent():
@animation.wait("refreshing metadata")
def regenAnimated():
- if os.path.isdir(portageMetadataDir):
- for files in os.listdir(portageMetadataDir):
- if os.path.isfile(os.path.join(portageMetadataDir, files)):
- os.remove(os.path.join(portageMetadataDir, files))
+ 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(portageMetadataDir, files))
+ shutil.rmtree(os.path.join(sisyphus.filesystem.portageMetadataDir, files))
portageExecStage1 = subprocess.Popen(['emerge', '--quiet', '--regen'], stdout=subprocess.PIPE)
portageExecStage1.wait()