summaryrefslogtreecommitdiff
path: root/src/backend/check.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/check.py')
-rw-r--r--src/backend/check.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/backend/check.py b/src/backend/check.py
index b2d8206..2c4cedb 100644
--- a/src/backend/check.py
+++ b/src/backend/check.py
@@ -2,11 +2,31 @@
import os
import subprocess
+import sisyphus.binhost
import sisyphus.filesystem
def root():
return True if os.getuid() == 0 else False
+def branch():
+ branchRepoMissmatch = int()
+ binhostURL = sisyphus.binhost.getURL()
+ localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])
+
+ os.chdir(sisyphus.filesystem.portageRepoDir)
+ if "packages-next" in binhostURL:
+ if localBranch.decode().strip() == "next":
+ branchRepoMissmatch = int(0)
+ else:
+ branchRepoMissmatch = int(1)
+ else:
+ if localBranch.decode().strip() == "master":
+ branchRepoMissmatch = int(0)
+ else:
+ branchRepoMissmatch = int(1)
+
+ return branchRepoMissmatch,localBranch
+
def portage():
if os.path.isdir(os.path.join(sisyphus.filesystem.portageRepoDir, '.git')):
os.chdir(sisyphus.filesystem.portageRepoDir)