summaryrefslogtreecommitdiff
path: root/src/backend/update.py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-31 02:31:22 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-31 02:31:22 +0000
commitfb13a317b1468c6070f4c6131a6526ffbf284511 (patch)
treea9f0a8df5958daa708f9597a87fb2bfacdcbf06c /src/backend/update.py
parentf59f14aee1d1a82b60e4274e4680b54280c225c5 (diff)
backend : refuse to run if there is a missmatch between the local branch and the binary repository
Diffstat (limited to 'src/backend/update.py')
-rw-r--r--src/backend/update.py56
1 files changed, 32 insertions, 24 deletions
diff --git a/src/backend/update.py b/src/backend/update.py
index 902c398..655b705 100644
--- a/src/backend/update.py
+++ b/src/backend/update.py
@@ -1,7 +1,9 @@
#!/usr/bin/python3
import animation
+import sys
import sisyphus.cache
+import sisyphus.binhost
import sisyphus.check
import sisyphus.database
import sisyphus.metadata
@@ -11,28 +13,34 @@ import sisyphus.sync
def start():
sisyphus.cache.clean()
- needsPortage = sisyphus.check.portage()
- needsOverlay = sisyphus.check.overlay()
+ binhostURL = sisyphus.binhost.getURL()
+ branchRepoMissmatch,localBranch = sisyphus.check.branch()
- if needsPortage == 1:
- if needsOverlay == 1:
- sisyphus.sync.portage()
- sisyphus.sync.overlay()
- sisyphus.sync.portageCfg()
- sisyphus.database.syncRemote()
- sisyphus.metadata.regenSilent()
- elif not needsOverlay == 1:
- sisyphus.sync.portage()
- sisyphus.sync.overlay()
- sisyphus.sync.portageCfg()
- sisyphus.database.syncRemote()
- sisyphus.metadata.regenSilent()
- elif not needsPortage == 1:
- if needsOverlay == 1:
- sisyphus.sync.portage()
- sisyphus.sync.overlay()
- sisyphus.sync.portageCfg()
- sisyphus.database.syncRemote()
- sisyphus.metadata.regenSilent()
- elif not needsOverlay == 1:
- sisyphus.sync.portageCfg()
+ if branchRepoMissmatch == 0:
+ needsPortage = sisyphus.check.portage()
+ needsOverlay = sisyphus.check.overlay()
+
+ if needsPortage == 1:
+ if needsOverlay == 1:
+ sisyphus.sync.portage()
+ sisyphus.sync.overlay()
+ sisyphus.sync.portageCfg()
+ sisyphus.database.syncRemote()
+ sisyphus.metadata.regenSilent()
+ elif not needsOverlay == 1:
+ sisyphus.sync.portage()
+ sisyphus.sync.overlay()
+ sisyphus.sync.portageCfg()
+ sisyphus.database.syncRemote()
+ sisyphus.metadata.regenSilent()
+ elif not needsPortage == 1:
+ if needsOverlay == 1:
+ sisyphus.sync.portage()
+ sisyphus.sync.overlay()
+ sisyphus.sync.portageCfg()
+ sisyphus.database.syncRemote()
+ sisyphus.metadata.regenSilent()
+ elif not needsOverlay == 1:
+ sisyphus.sync.portageCfg()
+ else:
+ sys.exit("\n" + "Branch :" + " '" + localBranch.decode().strip() + "' " + "\n" + "Repository :" + " '" + binhostURL + "' " + "\n" + "Branch - Repository missmatch; Quitting.")