From cabdf7f7238ad23e7d61074e542c065b86b25268 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 13 Jun 2008 11:59:36 +0200 Subject: * apt/cache.py: - add "memonly" option to apt.Cache() to force python-apt to not touch the pkgcache.bin file (this works around a possible race condition in the pkgcache.bin handling) --- apt/cache.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apt/cache.py') diff --git a/apt/cache.py b/apt/cache.py index a92bd5be..384afe31 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -41,8 +41,11 @@ class Cache(object): dictionary """ - def __init__(self, progress=None, rootdir=None): + def __init__(self, progress=None, rootdir=None, memonly=False): self._callbacks = {} + if memonly: + # force apt to build its caches in memory + apt_pkg.Config.Set("Dir::Cache::pkgcache","") if rootdir: apt_pkg.Config.Set("Dir", rootdir) apt_pkg.Config.Set("Dir::State::status", rootdir + "/var/lib/dpkg/status") -- cgit v1.2.3