From 46bdb849165a511fbf0efb87cc5c9f34e0a87d8e Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 17 Oct 2019 23:10:18 +0100 Subject: 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 --- src/backend/libsisyphus.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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): -- cgit v1.2.3