clearCache should get the latest values.. When it is called from manager.py it is only once read

but manager.py calls clearCache after calling setCache.. And because of that the old value is used.
The one that was read when manager.py initializes pisi.
This commit is contained in:
Faik Uygur
2008-05-09 08:57:01 +00:00
parent a53c07566c
commit 683df02437
+4 -3
View File
@@ -752,12 +752,13 @@ def clearCache(all=False):
pkgList = map(lambda x: os.path.basename(x).split(".pisi")[0], glob.glob("%s/*.pisi" % cacheDir)) pkgList = map(lambda x: os.path.basename(x).split(".pisi")[0], glob.glob("%s/*.pisi" % cacheDir))
if not all: if not all:
# Cache limits from pisi.conf # Cache limits from pisi.conf
limit = int(ctx.config.values.general.package_cache_limit) * 1024 * 1024 # is this safe? config = pisi.configfile.ConfigurationFile("/etc/pisi/pisi.conf")
if not limit: cacheLimit = int(config.get("general", "package_cache_limit")) * 1024 * 1024 # is this safe?
if not cacheLimit:
return return
old, latest = getPackageLists(pkgList) old, latest = getPackageLists(pkgList)
order = getRemoveOrder(cacheDir, latest) + getRemoveOrder(cacheDir, old) order = getRemoveOrder(cacheDir, latest) + getRemoveOrder(cacheDir, old)
removeOrderByLimit(cacheDir, order, limit) removeOrderByLimit(cacheDir, order, cacheLimit)
else: else:
removeAll(cacheDir) removeAll(cacheDir)