From bd91fd3fe3f2d9a214ecabaf2599b3acec3303dd Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 1 Jun 2019 16:50:19 +0100 Subject: libsisyphus : - implement binary package cache auto cleaning mechanism - stop relying on a portage hook to clean up the binary package cache - although the portage hook works OKish, it has some severe limitations : - it is not aware of partial downloads (it can never be, since sisyphus doesn't rely on portage but uses it's internal mechanism to download binary packages) - the cleaning itself is only partial, leaving empty directories behind - if a previous cleaning has failed (keyboard interrupt), it will confuse the dependency resolver --- src/backend/libsisyphus.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/backend') diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py index e64bd11..8993af0 100644 --- a/src/backend/libsisyphus.py +++ b/src/backend/libsisyphus.py @@ -181,9 +181,18 @@ def syncPortageCfg(): os.chdir(portageConfigDir) subprocess.call(['git', 'pull', '--quiet']) +def cleanCacheDir(): + if os.path.isdir(portageCacheDir): + for files in os.listdir(portageCacheDir): + if os.path.isfile(os.path.join(portageCacheDir, files)): + os.remove(os.path.join(portageCacheDir, files)) + else: + shutil.rmtree(os.path.join(portageCacheDir, files)) + @animation.wait('syncing remote database') def startUpdate(): checkRoot() + cleanCacheDir() syncPortageTree() syncPortageCfg() syncRemoteDatabase() -- cgit v1.2.3