diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/__init__.py | 4 | ||||
-rw-r--r-- | src/backend/branchsetup.py | 10 | ||||
-rw-r--r-- | src/backend/cache.py | 13 | ||||
-rw-r--r-- | src/backend/metadata.py | 15 | ||||
-rw-r--r-- | src/backend/purge.py (renamed from src/backend/branchreset.py) | 20 | ||||
-rw-r--r-- | src/backend/update.py | 3 |
6 files changed, 25 insertions, 40 deletions
diff --git a/src/backend/__init__.py b/src/backend/__init__.py index d868abb..7833aba 100644 --- a/src/backend/__init__.py +++ b/src/backend/__init__.py @@ -1,8 +1,6 @@ from .autoremove import * from .binhost import * -from .branchreset import * from .branchsetup import * -from .cache import * from .check import * from .csvfiles import * from .database import * @@ -13,8 +11,8 @@ from .filesystem import * from .forceuninstall import * from .install import * from .killportage import * -from .metadata import * from .mirror import * +from .purge import * from .rescue import * from .search import * from .setjobs import * diff --git a/src/backend/branchsetup.py b/src/backend/branchsetup.py index 793376b..2b12c3d 100644 --- a/src/backend/branchsetup.py +++ b/src/backend/branchsetup.py @@ -4,11 +4,9 @@ import animation import git import os import sys -import sisyphus.cache import sisyphus.check -import sisyphus.branchreset import sisyphus.filesystem -import sisyphus.metadata +import sisyphus.purge import sisyphus.setjobs import sisyphus.setprofile @@ -84,9 +82,9 @@ def warnAboutBinaryRepository(branch,remote): def start(branch,remote): if sisyphus.check.root(): - sisyphus.branchreset.start() - sisyphus.cache.purge() - sisyphus.metadata.purge() + sisyphus.purge.branch() + sisyphus.purge.cache() + sisyphus.purge.metadata() injectGentooPortageTree(branch,remote) injectRedcoreEbuildOverlay(branch,remote) injectRedcorePortageConfig(branch,remote) diff --git a/src/backend/cache.py b/src/backend/cache.py deleted file mode 100644 index ed291f0..0000000 --- a/src/backend/cache.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/python3 - -import os -import shutil -import sisyphus.filesystem - -def purge(): - if os.path.isdir(sisyphus.filesystem.portageCacheDir): - for files in os.listdir(sisyphus.filesystem.portageCacheDir): - if os.path.isfile(os.path.join(sisyphus.filesystem.portageCacheDir, files)): - os.remove(os.path.join(sisyphus.filesystem.portageCacheDir, files)) - else: - shutil.rmtree(os.path.join(sisyphus.filesystem.portageCacheDir, files)) diff --git a/src/backend/metadata.py b/src/backend/metadata.py deleted file mode 100644 index f906c95..0000000 --- a/src/backend/metadata.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/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)) diff --git a/src/backend/branchreset.py b/src/backend/purge.py index 6df4347..3a94cff 100644 --- a/src/backend/branchreset.py +++ b/src/backend/purge.py @@ -5,8 +5,8 @@ import os import shutil import sisyphus.filesystem -@animation.wait('resetting branch configuration') -def start(): +@animation.wait('purging branch configuration') +def branch(): if os.path.isdir(sisyphus.filesystem.portageRepoDir): for files in os.listdir(sisyphus.filesystem.portageRepoDir): if os.path.isfile(os.path.join(sisyphus.filesystem.portageRepoDir, files)): @@ -33,3 +33,19 @@ def start(): shutil.rmtree(os.path.join(sisyphus.filesystem.portageConfigDir, files)) else: os.makedirs(sisyphus.filesystem.portageConfigDir) + +def cache(): + if os.path.isdir(sisyphus.filesystem.portageCacheDir): + for files in os.listdir(sisyphus.filesystem.portageCacheDir): + if os.path.isfile(os.path.join(sisyphus.filesystem.portageCacheDir, files)): + os.remove(os.path.join(sisyphus.filesystem.portageCacheDir, files)) + else: + shutil.rmtree(os.path.join(sisyphus.filesystem.portageCacheDir, files)) + +def metadata(): + 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)) diff --git a/src/backend/update.py b/src/backend/update.py index 82281fe..0253118 100644 --- a/src/backend/update.py +++ b/src/backend/update.py @@ -3,13 +3,14 @@ import animation import sys import time -import sisyphus.cache import sisyphus.binhost import sisyphus.check import sisyphus.database +import sisyphus.purge import sisyphus.sync def syncAll(): + sisyphus.purge.cache() sisyphus.sync.portage() sisyphus.sync.overlay() sisyphus.sync.portageCfg() |