diff options
| author | Otavio Salvador <otavio@debian.org> | 2006-06-14 00:31:49 -0300 |
|---|---|---|
| committer | Otavio Salvador <otavio@debian.org> | 2006-06-14 00:31:49 -0300 |
| commit | 473031d5c8273643592d2f269fd532afb560303c (patch) | |
| tree | 2217d1ecd032b50d99ada4494410f9f4d83c0a3c | |
| parent | 22e59d0dc92c45ea63d75d73474b5be610e57a58 (diff) | |
| download | python-apt-473031d5c8273643592d2f269fd532afb560303c.tar.gz | |
- allow change of rootdir for APT database loading
| -rw-r--r-- | apt/cache.py | 6 | ||||
| -rw-r--r-- | debian/changelog | 1 |
2 files changed, 6 insertions, 1 deletions
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): diff --git a/debian/changelog b/debian/changelog index ff62eac6..287605e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ python-apt (0.6.18) unstable; urgency=low [ Otavio Salvador ] * apt/cache.py: - fix commit doc string to also cite the open related callbacks + - allow change of rootdir for APT database loading -- |
