summaryrefslogtreecommitdiff
path: root/apt/cache.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-07-27 15:00:12 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-07-27 15:00:12 +0200
commitaf398fcce8671bc864e4300c1b0bbeb07ab95aaf (patch)
treee89efbe87083941ab7a220c3a9a93f0e9f6df05c /apt/cache.py
parent0b081c5451d6394618290cd9a5767d767d98b819 (diff)
parent8d79b99c1a3338e31e8def858cee3209824ae8bf (diff)
downloadpython-apt-af398fcce8671bc864e4300c1b0bbeb07ab95aaf.tar.gz
* merged with mainline
Diffstat (limited to 'apt/cache.py')
-rw-r--r--apt/cache.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/apt/cache.py b/apt/cache.py
index 01034cf9..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):
@@ -218,7 +222,7 @@ class Cache(object):
def connect(self, name, callback):
""" connect to a signal, currently only used for
- cache_{post,pre}_changed """
+ cache_{post,pre}_{changed,open} """
if not self._callbacks.has_key(name):
self._callbacks[name] = []
self._callbacks[name].append(callback)