summaryrefslogtreecommitdiff
path: root/apt/cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'apt/cache.py')
-rw-r--r--apt/cache.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/apt/cache.py b/apt/cache.py
index 40808abd..f507863c 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -69,6 +69,9 @@ class Cache(object):
# create required dirs/files when run with special rootdir
# automatically
self._check_and_create_required_dirs(rootdir)
+ # Call InitSystem so the change to Dir::State::Status is actually
+ # recognized (LP: #320665)
+ apt_pkg.InitSystem()
self.open(progress)
def _check_and_create_required_dirs(self, rootdir):
@@ -106,9 +109,6 @@ class Cache(object):
progress = apt.progress.text.OpProgress()
self._run_callbacks("cache_pre_open")
- # Make changes to Dir::State::Status work again, by reinitialising
- # the system.
- apt_pkg.init_system()
self._cache = apt_pkg.Cache(progress)
self._depcache = apt_pkg.DepCache(self._cache)
self._records = apt_pkg.PackageRecords(self._cache)