From 12c2d64d475552f7ccfb078613a8fbfcea1efaba Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 6 Sep 2019 11:38:35 +0100 Subject: Bugfix && feature : * since our sync method is different than portage, sisyphus may fail to resolve dependencies properly in certain cases * copy portage's behaviour, perform global updates (SLOT moves, blockers etc) and refresh the metadata after every sync * while this will slow down the sync a little, it will accelerate dependency solving considerably --- src/backend/libsisyphus.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py index a188fb4..8af5bf7 100644 --- a/src/backend/libsisyphus.py +++ b/src/backend/libsisyphus.py @@ -15,6 +15,7 @@ gentooEbuildDir = '/usr/ports/gentoo' redcoreEbuildDir = '/usr/ports/redcore' portageConfigDir = '/opt/redcore-build' portageCacheDir = '/var/cache/packages' +portageMetadataDir = '/var/cache/edb' remotePkgsDB = '/var/lib/sisyphus/csv/remotePackagesPre.csv' remoteDscsDB = '/var/lib/sisyphus/csv/remoteDescriptionsPre.csv' localPkgsDB = '/var/lib/sisyphus/csv/localPackagesPre.csv' @@ -212,6 +213,20 @@ def syncPortageCfg(): subprocess.call(['git', 'fetch', '--depth=1', 'origin', 'next', '--quiet']) subprocess.call(['git', 'reset', '--hard', 'origin/next', '--quiet']) +def syncPortageMtd(): + if os.path.isdir(portageMetadataDir): + for files in os.listdir(portageMetadataDir): + if os.path.isfile(os.path.join(portageMetadataDir, files)): + os.remove(os.path.join(portageMetadataDir, files)) + else: + shutil.rmtree(os.path.join(portageMetadataDir, files)) + + portageExecStage1 = subprocess.Popen(['emerge', '--quiet', '--regen'], stdout=subprocess.PIPE) + portageExecStage2 = subprocess.Popen(['emerge', '--quiet', '--metadata'], stdout=subprocess.PIPE) + + portageExecStage1.wait() + portageExecStage2.wait() + def cleanCacheDir(): if os.path.isdir(portageCacheDir): for files in os.listdir(portageCacheDir): @@ -227,6 +242,7 @@ def startUpdate(): syncPortageTree() syncOverlayTree() syncPortageCfg() + syncPortageMtd() syncRemoteDatabase() @animation.wait('syncing spm changes') -- cgit v1.2.3