From 9bb89285b638c1b2fb86a8d3234a176b5688009a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 30 Oct 2022 14:33:29 +0000 Subject: move purgeEnvironment -> purgeenv --- src/backend/__init__.py | 2 +- src/backend/purgeEnvironment.py | 51 ----------------------------------------- src/backend/purgeenv.py | 51 +++++++++++++++++++++++++++++++++++++++++ src/backend/setBranch.py | 6 ++--- src/backend/updateAll.py | 4 ++-- 5 files changed, 57 insertions(+), 57 deletions(-) delete mode 100644 src/backend/purgeEnvironment.py create mode 100644 src/backend/purgeenv.py (limited to 'src/backend') diff --git a/src/backend/__init__.py b/src/backend/__init__.py index f1261c4..3b6ff15 100644 --- a/src/backend/__init__.py +++ b/src/backend/__init__.py @@ -5,7 +5,7 @@ from .getfs import * from .installPkg import * from .installSrc import * from .killPortage import * -from .purgeEnvironment import * +from .purgeenv import * from .recoverDatabase import * from .resolveDeps import * from .searchPkg import * diff --git a/src/backend/purgeEnvironment.py b/src/backend/purgeEnvironment.py deleted file mode 100644 index b5424a6..0000000 --- a/src/backend/purgeEnvironment.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/python3 - -import animation -import os -import shutil -import sisyphus.getfs - -@animation.wait('purging branch configuration') -def branch(): - if os.path.isdir(sisyphus.getfs.gentooRepoDir): - for files in os.listdir(sisyphus.getfs.gentooRepoDir): - if os.path.isfile(os.path.join(sisyphus.getfs.gentooRepoDir, files)): - os.remove(os.path.join(sisyphus.getfs.gentooRepoDir, files)) - else: - shutil.rmtree(os.path.join(sisyphus.getfs.gentooRepoDir, files)) - else: - os.makedirs(sisyphus.getfs.gentooRepoDir) - - if os.path.isdir(sisyphus.getfs.redcoreRepoDir): - for files in os.listdir(sisyphus.getfs.redcoreRepoDir): - if os.path.isfile(os.path.join(sisyphus.getfs.redcoreRepoDir, files)): - os.remove(os.path.join(sisyphus.getfs.redcoreRepoDir, files)) - else: - shutil.rmtree(os.path.join(sisyphus.getfs.redcoreRepoDir, files)) - else: - os.makedirs(sisyphus.getfs.redcoreRepoDir) - - if os.path.isdir(sisyphus.getfs.portageConfigDir): - for files in os.listdir(sisyphus.getfs.portageConfigDir): - if os.path.isfile(os.path.join(sisyphus.getfs.portageConfigDir, files)): - os.remove(os.path.join(sisyphus.getfs.portageConfigDir, files)) - else: - shutil.rmtree(os.path.join(sisyphus.getfs.portageConfigDir, files)) - else: - os.makedirs(sisyphus.getfs.portageConfigDir) - -def cache(): - if os.path.isdir(sisyphus.getfs.portageCacheDir): - for files in os.listdir(sisyphus.getfs.portageCacheDir): - if os.path.isfile(os.path.join(sisyphus.getfs.portageCacheDir, files)): - os.remove(os.path.join(sisyphus.getfs.portageCacheDir, files)) - else: - shutil.rmtree(os.path.join(sisyphus.getfs.portageCacheDir, files)) - -def metadata(): - if os.path.isdir(sisyphus.getfs.portageMetadataDir): - for files in os.listdir(sisyphus.getfs.portageMetadataDir): - if os.path.isfile(os.path.join(sisyphus.getfs.portageMetadataDir, files)): - os.remove(os.path.join(sisyphus.getfs.portageMetadataDir, files)) - else: - shutil.rmtree(os.path.join(sisyphus.getfs.portageMetadataDir, files)) diff --git a/src/backend/purgeenv.py b/src/backend/purgeenv.py new file mode 100644 index 0000000..b5424a6 --- /dev/null +++ b/src/backend/purgeenv.py @@ -0,0 +1,51 @@ +#!/usr/bin/python3 + +import animation +import os +import shutil +import sisyphus.getfs + +@animation.wait('purging branch configuration') +def branch(): + if os.path.isdir(sisyphus.getfs.gentooRepoDir): + for files in os.listdir(sisyphus.getfs.gentooRepoDir): + if os.path.isfile(os.path.join(sisyphus.getfs.gentooRepoDir, files)): + os.remove(os.path.join(sisyphus.getfs.gentooRepoDir, files)) + else: + shutil.rmtree(os.path.join(sisyphus.getfs.gentooRepoDir, files)) + else: + os.makedirs(sisyphus.getfs.gentooRepoDir) + + if os.path.isdir(sisyphus.getfs.redcoreRepoDir): + for files in os.listdir(sisyphus.getfs.redcoreRepoDir): + if os.path.isfile(os.path.join(sisyphus.getfs.redcoreRepoDir, files)): + os.remove(os.path.join(sisyphus.getfs.redcoreRepoDir, files)) + else: + shutil.rmtree(os.path.join(sisyphus.getfs.redcoreRepoDir, files)) + else: + os.makedirs(sisyphus.getfs.redcoreRepoDir) + + if os.path.isdir(sisyphus.getfs.portageConfigDir): + for files in os.listdir(sisyphus.getfs.portageConfigDir): + if os.path.isfile(os.path.join(sisyphus.getfs.portageConfigDir, files)): + os.remove(os.path.join(sisyphus.getfs.portageConfigDir, files)) + else: + shutil.rmtree(os.path.join(sisyphus.getfs.portageConfigDir, files)) + else: + os.makedirs(sisyphus.getfs.portageConfigDir) + +def cache(): + if os.path.isdir(sisyphus.getfs.portageCacheDir): + for files in os.listdir(sisyphus.getfs.portageCacheDir): + if os.path.isfile(os.path.join(sisyphus.getfs.portageCacheDir, files)): + os.remove(os.path.join(sisyphus.getfs.portageCacheDir, files)) + else: + shutil.rmtree(os.path.join(sisyphus.getfs.portageCacheDir, files)) + +def metadata(): + if os.path.isdir(sisyphus.getfs.portageMetadataDir): + for files in os.listdir(sisyphus.getfs.portageMetadataDir): + if os.path.isfile(os.path.join(sisyphus.getfs.portageMetadataDir, files)): + os.remove(os.path.join(sisyphus.getfs.portageMetadataDir, files)) + else: + shutil.rmtree(os.path.join(sisyphus.getfs.portageMetadataDir, files)) diff --git a/src/backend/setBranch.py b/src/backend/setBranch.py index 01d570e..4ee3e83 100644 --- a/src/backend/setBranch.py +++ b/src/backend/setBranch.py @@ -6,7 +6,7 @@ import os import sys import sisyphus.checkenv import sisyphus.getfs -import sisyphus.purgeEnvironment +import sisyphus.purgeenv import sisyphus.setJobs import sisyphus.setProfile @@ -81,8 +81,8 @@ def giveWarning(branch,remote): def cliExec(branch,remote): if sisyphus.checkenv.root(): - sisyphus.purgeEnvironment.branch() - sisyphus.purgeEnvironment.metadata() + sisyphus.purgeenv.branch() + sisyphus.purgeenv.metadata() injectGentooRepo(branch,remote) injectRedcoreRepo(branch,remote) injectPortageConfigRepo(branch,remote) diff --git a/src/backend/updateAll.py b/src/backend/updateAll.py index bf95266..d7d1203 100644 --- a/src/backend/updateAll.py +++ b/src/backend/updateAll.py @@ -5,12 +5,12 @@ import sys import time import sisyphus.checkenv import sisyphus.getenv -import sisyphus.purgeEnvironment +import sisyphus.purgeenv import sisyphus.syncDatabase import sisyphus.syncEnvironment def syncAll(): - sisyphus.purgeEnvironment.cache() + sisyphus.purgeenv.cache() sisyphus.syncEnvironment.gentooRepo() sisyphus.syncEnvironment.redcoreRepo() sisyphus.syncEnvironment.portageConfigRepo() -- cgit v1.2.3