From 473031d5c8273643592d2f269fd532afb560303c Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 14 Jun 2006 00:31:49 -0300 Subject: - allow change of rootdir for APT database loading --- apt/cache.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apt/cache.py') diff --git a/apt/cache.py b/apt/cache.py index 8410fc56..690510e3 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -31,10 +31,14 @@ class Cache(object): dictionary """ - def __init__(self, progress=None): + def __init__(self, progress=None, rootdir=None): self._callbacks = {} self.open(progress) + if rootdir: + apt_pkg.Config.Set("Dir", rootdir) + apt_pkg.Config.Set("Dir::State::status", rootdir + "/var/lib/dpkg/status") + def _runCallbacks(self, name): """ internal helper to run a callback """ if self._callbacks.has_key(name): -- cgit v1.2.3