diff options
| -rw-r--r-- | apt/cache.py | 5 | ||||
| -rw-r--r-- | debian/changelog | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/apt/cache.py b/apt/cache.py index 2f0eda59..43fb55d7 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -82,13 +82,16 @@ class Cache(object): apt_pkg.config.set("Dir::Cache::pkgcache", "") if rootdir: rootdir = os.path.abspath(rootdir) + # clear old config first (Bug#728274) + apt_pkg.config.clear("APT") + apt_pkg.config.set("Dir", rootdir) + apt_pkg.init_config() if os.path.exists(rootdir+"/etc/apt/apt.conf"): apt_pkg.read_config_file(apt_pkg.config, rootdir + "/etc/apt/apt.conf") if os.path.isdir(rootdir+"/etc/apt/apt.conf.d"): apt_pkg.read_config_dir(apt_pkg.config, rootdir + "/etc/apt/apt.conf.d") - apt_pkg.config.set("Dir", rootdir) apt_pkg.config.set("Dir::State::status", rootdir + "/var/lib/dpkg/status") # also set dpkg to the rootdir path so that its called for the diff --git a/debian/changelog b/debian/changelog index 06c6946c..52a1000e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +python-apt (0.9.2) UNRELEASED; urgency=low + + * apt/cache.py: + - when using apt.Cache(rootdir=/some/dir) only read the APT + configuration from this rootdir instead of /etc (closes: #728274) + + -- Michael Vogt <michael.vogt@ubuntu.com> Sat, 23 Nov 2013 08:49:51 +0100 + python-apt (0.9.1) unstable; urgency=low * data/templates/Ubuntu.info.in: It's 'Tahr', not 'Thar' |
