diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-06-06 16:22:04 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-06-06 16:22:04 +0100 |
commit | ac0efd1bd6c703147bd8d3caedf489fab87d6131 (patch) | |
tree | e6af981b6e90be35447dbb88dd276a4d8ff2d47e /src/backend/branchmaster.py | |
parent | 49e6ab19aa461151132dfb4f1cf962d4ef403c66 (diff) |
big rewrite : split the backend in smaller pieces, rework the cli frontend to work with the new backend ... gui frontend wip
Diffstat (limited to 'src/backend/branchmaster.py')
-rw-r--r-- | src/backend/branchmaster.py | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/backend/branchmaster.py b/src/backend/branchmaster.py new file mode 100644 index 0000000..6229511 --- /dev/null +++ b/src/backend/branchmaster.py @@ -0,0 +1,73 @@ +#!/usr/bin/python3 + +import animation +import os +import subprocess + +gentooEbuildDir = '/usr/ports/gentoo' +redcoreEbuildDir = '/usr/ports/redcore' +portageConfigDir = '/opt/redcore-build' + +@animation.wait('injecting gentoo linux portage tree - branch master') +def setGitlabMasterStage1(): + if not os.path.isdir(os.path.join(gentooEbuildDir, '.git')): + os.chdir(gentooEbuildDir) + subprocess.call(['git', 'init', '-q']) + subprocess.call(['git', 'remote', 'add', 'origin', 'https://gitlab.com/redcore/portage.git']) + subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet']) + subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet']) + +@animation.wait('injecting redcore linux ebuild tree - branch master') +def setGitlabMasterStage2(): + if not os.path.isdir(os.path.join(redcoreEbuildDir, '.git')): + os.chdir(redcoreEbuildDir) + subprocess.call(['git', 'init', '-q']) + subprocess.call(['git', 'remote', 'add', 'origin', 'https://gitlab.com/redcore/redcore-desktop.git']) + subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet']) + subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet']) + +@animation.wait('injecting redcore linux portage configuration - branch master') +def setGitlabMasterStage3(): + if not os.path.isdir(os.path.join(portageConfigDir, '.git')): + os.chdir(portageConfigDir) + subprocess.call(['git', 'init', '-q']) + subprocess.call(['git', 'remote', 'add', 'origin', 'https://gitlab.com/redcore/redcore-build.git']) + subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet']) + subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet']) + +def gitlabStart(): + setGitlabMasterStage1() + setGitlabMasterStage2() + setGitlabMasterStage3() + +@animation.wait('injecting gentoo linux portage tree - branch master') +def setPagureMasterStage1(): + if not os.path.isdir(os.path.join(gentooEbuildDir, '.git')): + os.chdir(gentooEbuildDir) + subprocess.call(['git', 'init', '-q']) + subprocess.call(['git', 'remote', 'add', 'origin', 'https://pagure.io/redcore/portage.git']) + subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet']) + subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet']) + +@animation.wait('injecting redcore linux ebuild tree - branch master') +def setPagureMasterStage2(): + if not os.path.isdir(os.path.join(redcoreEbuildDir, '.git')): + os.chdir(redcoreEbuildDir) + subprocess.call(['git', 'init', '-q']) + subprocess.call(['git', 'remote', 'add', 'origin', 'https://pagure.io/redcore/redcore-desktop.git']) + subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet']) + subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet']) + +@animation.wait('injecting redcore linux portage configuration - branch master') +def setPagureMasterStage3(): + if not os.path.isdir(os.path.join(portageConfigDir, '.git')): + os.chdir(portageConfigDir) + subprocess.call(['git', 'init', '-q']) + subprocess.call(['git', 'remote', 'add', 'origin', 'https://pagure.io/redcore/redcore-build.git']) + subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'master', '--quiet']) + subprocess.call(['git', 'checkout', '-b', 'master', 'origin/master', '--quiet']) + +def pagureStart(): + setPagureMasterStage1() + setPagureMasterStage2() + setPagureMasterStage3() |