summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-09-15 11:45:16 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-09-15 11:45:16 +0100
commite3f87d670b32727cc91d0b3654e6da72b469010a (patch)
tree6b7d64235222728495e6c4a8d4c24a56054efabf
parentb2db44be90a67db8005fb73024db59e22060bef6 (diff)
regenerate portage metadata whenever we're changing the branches, rename some functionsv3.1909.2
-rw-r--r--src/backend/libsisyphus.py22
-rwxr-xr-xsrc/frontend/cli/sisyphus-cli.py2
-rw-r--r--src/frontend/gui/sisyphus-gui.py2
3 files changed, 15 insertions, 11 deletions
diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py
index d1afc06..ed6afb1 100644
--- a/src/backend/libsisyphus.py
+++ b/src/backend/libsisyphus.py
@@ -232,7 +232,7 @@ def syncOverlayTree():
gitExecStage2 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE)
gitExecStage2.wait()
-def syncPortageCfg():
+def syncPortageConfig():
os.chdir(portageConfigDir)
localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])
remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}'])
@@ -242,7 +242,7 @@ def syncPortageCfg():
gitExecStage2 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE)
gitExecStage2.wait()
-def syncPortageMtd():
+def regenPortageMetadata():
if os.path.isdir(portageMetadataDir):
for files in os.listdir(portageMetadataDir):
if os.path.isfile(os.path.join(portageMetadataDir, files)):
@@ -263,7 +263,7 @@ def cleanCacheDir():
else:
shutil.rmtree(os.path.join(portageCacheDir, files))
-def checkSync():
+def checkUpdate():
checkPortageTree()
checkOverlayTree()
@@ -279,22 +279,22 @@ def startUpdate():
if needsOverlayTreeSync == 1:
syncPortageTree()
syncOverlayTree()
- syncPortageCfg()
- syncPortageMtd()
+ syncPortageConfig()
syncRemoteDatabase()
+ regenPortageMetadata()
elif not needsOverlayTreeSync == 1:
syncPortageTree()
syncOverlayTree()
- syncPortageCfg()
- syncPortageMtd()
+ syncPortageConfig()
syncRemoteDatabase()
+ regenPortageMetadata()
elif not needsPortageTreeSync == 1:
if needsOverlayTreeSync == 1:
syncPortageTree()
syncOverlayTree()
- syncPortageCfg()
- syncPortageMtd()
+ syncPortageConfig()
syncRemoteDatabase()
+ regenPortageMetadata()
elif not needsOverlayTreeSync == 1:
pass
@@ -770,6 +770,7 @@ def injectGitlabMaster():
setGitlabMaster()
setHardenedProfile()
setJobs()
+ regenPortageMetadata()
def injectPagureMaster():
checkRoot()
@@ -777,6 +778,7 @@ def injectPagureMaster():
setPagureMaster()
setHardenedProfile()
setJobs()
+ regenPortageMetadata()
def injectGitlabNext():
checkRoot()
@@ -784,6 +786,7 @@ def injectGitlabNext():
setGitlabNext()
setHardenedProfile()
setJobs()
+ regenPortageMetadata()
def injectPagureNext():
checkRoot()
@@ -791,6 +794,7 @@ def injectPagureNext():
setPagureNext()
setHardenedProfile()
setJobs()
+ regenPortageMetadata()
def showHelp():
print("\n" + "Usage : sisyphus command [package(s)] || [file(s)]" + "\n")
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py
index 9a389d8..c78f939 100755
--- a/src/frontend/cli/sisyphus-cli.py
+++ b/src/frontend/cli/sisyphus-cli.py
@@ -3,7 +3,7 @@
import sys
from libsisyphus import *
-checkSync()
+checkUpdate()
setJobs.__wrapped__() #undecorate
pkgList = sys.argv[2:]
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index bc985e1..af98396 100644
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -382,7 +382,7 @@ class MainWorker(QtCore.QObject):
@QtCore.pyqtSlot()
def startUpdate(self):
self.started.emit()
- checkSync()
+ checkUpdate()
setJobs.__wrapped__() #undecorate
startUpdate.__wrapped__() #undecorate
self.finished.emit()