summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-06-01 16:50:19 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-06-01 16:50:19 +0100
commitbd91fd3fe3f2d9a214ecabaf2599b3acec3303dd (patch)
tree7c8af1a2dd6483352b9f14cce02e70bf2599d5e5 /src
parent266820fbac1cac1d5330021482bcee33728e5dbe (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/libsisyphus.py9
1 files changed, 9 insertions, 0 deletions
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()