summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-10-17 23:10:18 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-10-17 23:10:18 +0100
commit46bdb849165a511fbf0efb87cc5c9f34e0a87d8e (patch)
treef61955d270e871393bbf6ffd81a3c6c69c43bf44
parentf37a767ba3a4326502eb7ebb29c3e7621b0a480b (diff)
bugfix :
* git reset --hard is a bit overkill for portage config files sync as it will reset MAKEOPTS, custom USE flags, keywords, masks etc * to preserve them, use git stash right before the hard reset, and then apply the stash
-rw-r--r--src/backend/libsisyphus.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py
index 7425530..aab0522 100644
--- a/src/backend/libsisyphus.py
+++ b/src/backend/libsisyphus.py
@@ -237,10 +237,14 @@ def syncPortageConfig():
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 = subprocess.Popen(['git', 'stash'], stdout=subprocess.PIPE)
gitExecStage1.wait()
- gitExecStage2 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE)
+ 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()
def regenPortageMetadata():
if os.path.isdir(portageMetadataDir):