diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-09-18 15:00:19 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-09-18 15:00:19 +0100 |
commit | 02a67877e808bf2f3cf637bcc5694907ae6c2f00 (patch) | |
tree | 75452db989d080adead0052a2771c2d2fafbc098 /src/backend | |
parent | 492accf8661f8081ffe9c6c3bccb5f4c2c75e7d6 (diff) |
shave off some duplicated codev4.2009.0
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/metadata.py | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/backend/metadata.py b/src/backend/metadata.py index a27e06a..99384a0 100644 --- a/src/backend/metadata.py +++ b/src/backend/metadata.py @@ -6,7 +6,7 @@ import shutil import subprocess import sisyphus.filesystem -def regenSilent(): +def regenMetadata(): 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)): @@ -19,16 +19,9 @@ def regenSilent(): portageExecStage2 = subprocess.Popen(['emerge', '--quiet', '--metadata'], stdout=subprocess.PIPE) portageExecStage2.wait() -@animation.wait("refreshing metadata") -def regenAnimated(): - 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)) +def regenSilent(): + regenMetadata() - portageExecStage1 = subprocess.Popen(['emerge', '--quiet', '--regen'], stdout=subprocess.PIPE) - portageExecStage1.wait() - portageExecStage2 = subprocess.Popen(['emerge', '--quiet', '--metadata'], stdout=subprocess.PIPE) - portageExecStage2.wait() +@animation.wait("regenerating package metadata") +def regenAnimated(): + regenMetadata() |