From f7f86f807d2756f5081c0e0f1dfc9ead61ac9f5c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 30 Oct 2022 15:15:20 +0000 Subject: move syncEnvironment -> syncenv --- src/backend/__init__.py | 2 +- src/backend/syncEnvironment.py | 45 ------------------------------------------ src/backend/syncenv.py | 45 ++++++++++++++++++++++++++++++++++++++++++ src/backend/updateAll.py | 8 ++++---- 4 files changed, 50 insertions(+), 50 deletions(-) delete mode 100644 src/backend/syncEnvironment.py create mode 100644 src/backend/syncenv.py diff --git a/src/backend/__init__.py b/src/backend/__init__.py index 6a36d58..c3dc928 100644 --- a/src/backend/__init__.py +++ b/src/backend/__init__.py @@ -15,7 +15,7 @@ from .setjobs import * from .setMirror import * from .setprofile import * from .syncdb import * -from .syncEnvironment import * +from .syncenv import * from .syncSPM import * from .sysInfo import * from .uninstallAll import * diff --git a/src/backend/syncEnvironment.py b/src/backend/syncEnvironment.py deleted file mode 100644 index 2b3277f..0000000 --- a/src/backend/syncEnvironment.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/python3 - -import os -import subprocess -import sisyphus.getfs - -def gentooRepo(): - os.chdir(sisyphus.getfs.gentooRepoDir) - localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) - remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) - - gitExecStage1 = subprocess.Popen(['git', 'fetch', '--depth=1', 'origin'] + localBranch.decode().strip().split() + ['--quiet'], stdout=subprocess.PIPE) - gitExecStage1.wait() - - gitExecStage2 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE) - gitExecStage2.wait() - -def redcoreRepo(): - os.chdir(sisyphus.getfs.redcoreRepoDir) - localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) - remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) - - gitExecStage1 = subprocess.Popen(['git', 'fetch', '--depth=1', 'origin'] + localBranch.decode().strip().split() + ['--quiet'], stdout=subprocess.PIPE) - gitExecStage1.wait() - - gitExecStage2 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE) - gitExecStage2.wait() - -def portageConfigRepo(): - os.chdir(sisyphus.getfs.portageConfigDir) - localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) - remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) - - gitExecStage1 = subprocess.Popen(['git', 'stash'], stdout=subprocess.PIPE) - gitExecStage1.wait() - gitExecStage2 = subprocess.Popen(['git', 'fetch', '--depth=1', 'origin'] + localBranch.decode().strip().split() + ['--quiet'], stdout=subprocess.PIPE) - gitExecStage2.wait() - gitExecStage3 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE) - gitExecStage3.wait() - gitExecStage4 = subprocess.Popen(['git', 'stash', 'apply'], stdout=subprocess.PIPE) - gitExecStage4.wait() - gitExecStage5 = subprocess.Popen(['git', 'stash', 'clear'], stdout=subprocess.PIPE) - gitExecStage5.wait() - gitExecStage6 = subprocess.Popen(['git', 'gc', '--prune=now', '--quiet'], stdout=subprocess.PIPE) - gitExecStage6.wait() diff --git a/src/backend/syncenv.py b/src/backend/syncenv.py new file mode 100644 index 0000000..2b3277f --- /dev/null +++ b/src/backend/syncenv.py @@ -0,0 +1,45 @@ +#!/usr/bin/python3 + +import os +import subprocess +import sisyphus.getfs + +def gentooRepo(): + os.chdir(sisyphus.getfs.gentooRepoDir) + localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) + remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) + + gitExecStage1 = subprocess.Popen(['git', 'fetch', '--depth=1', 'origin'] + localBranch.decode().strip().split() + ['--quiet'], stdout=subprocess.PIPE) + gitExecStage1.wait() + + gitExecStage2 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE) + gitExecStage2.wait() + +def redcoreRepo(): + os.chdir(sisyphus.getfs.redcoreRepoDir) + localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) + remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) + + gitExecStage1 = subprocess.Popen(['git', 'fetch', '--depth=1', 'origin'] + localBranch.decode().strip().split() + ['--quiet'], stdout=subprocess.PIPE) + gitExecStage1.wait() + + gitExecStage2 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE) + gitExecStage2.wait() + +def portageConfigRepo(): + os.chdir(sisyphus.getfs.portageConfigDir) + localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) + remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) + + gitExecStage1 = subprocess.Popen(['git', 'stash'], stdout=subprocess.PIPE) + gitExecStage1.wait() + gitExecStage2 = subprocess.Popen(['git', 'fetch', '--depth=1', 'origin'] + localBranch.decode().strip().split() + ['--quiet'], stdout=subprocess.PIPE) + gitExecStage2.wait() + gitExecStage3 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE) + gitExecStage3.wait() + gitExecStage4 = subprocess.Popen(['git', 'stash', 'apply'], stdout=subprocess.PIPE) + gitExecStage4.wait() + gitExecStage5 = subprocess.Popen(['git', 'stash', 'clear'], stdout=subprocess.PIPE) + gitExecStage5.wait() + gitExecStage6 = subprocess.Popen(['git', 'gc', '--prune=now', '--quiet'], stdout=subprocess.PIPE) + gitExecStage6.wait() diff --git a/src/backend/updateAll.py b/src/backend/updateAll.py index 6abcb70..5a6a6cd 100644 --- a/src/backend/updateAll.py +++ b/src/backend/updateAll.py @@ -7,13 +7,13 @@ import sisyphus.checkenv import sisyphus.getenv import sisyphus.purgeenv import sisyphus.syncdb -import sisyphus.syncEnvironment +import sisyphus.syncenv def syncAll(): sisyphus.purgeenv.cache() - sisyphus.syncEnvironment.gentooRepo() - sisyphus.syncEnvironment.redcoreRepo() - sisyphus.syncEnvironment.portageConfigRepo() + sisyphus.syncenv.gentooRepo() + sisyphus.syncenv.redcoreRepo() + sisyphus.syncenv.portageConfigRepo() sisyphus.syncdb.remoteTable() @animation.wait('fetching updates') -- cgit v1.2.3