diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-01-31 01:19:56 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-01-31 01:19:56 +0000 |
commit | e4f2e722b2740d16ddc2ffa9b184287a7850b203 (patch) | |
tree | d22fa625f7d4a31625d8153d2630c3a71f58b978 /src/backend/check.py | |
parent | 5eaef5fdcc4648c6156b0a5f6d8a2907c2a5a303 (diff) |
backend : reuse binhost module in csvfiles module, one less portage call
Diffstat (limited to 'src/backend/check.py')
-rw-r--r-- | src/backend/check.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/backend/check.py b/src/backend/check.py index b2d8206..d5d3aca 100644 --- a/src/backend/check.py +++ b/src/backend/check.py @@ -2,11 +2,34 @@ import os import subprocess +import sisyphus.binhost import sisyphus.filesystem def root(): return True if os.getuid() == 0 else False + +def branch(): + binhostURL = sisyphus.binhost.getURL() + localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) + mismatch = int() + + if "packages-next" in binhostURL: + os.chdir(sisyphus.filesystem.portageRepoDir) + if localBranch.decode().strip() == "next": + print(binhostURL.replace('packages-next', 'csv-next') + 'remotePackagesPre.csv') + mismatch = int(0) + else: + mismatch = int(1) + else: + if localBranch.decode().strip() == "master": + mismatch = int(0) + else: + mismatch = int(1) + + return localBranch,mismatch +branch() + def portage(): if os.path.isdir(os.path.join(sisyphus.filesystem.portageRepoDir, '.git')): os.chdir(sisyphus.filesystem.portageRepoDir) |