summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/cachefile.cc')
-rw-r--r--apt-pkg/cachefile.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc
index 39f1e72db..92a3b201b 100644
--- a/apt-pkg/cachefile.cc
+++ b/apt-pkg/cachefile.cc
@@ -96,7 +96,8 @@ bool pkgCacheFile::BuildCaches(OpProgress *Progress, bool WithLock)
BuildSourceList(Progress);
// Read the caches
- bool Res = pkgCacheGenerator::MakeStatusCache(*SrcList,Progress,&Map, true);
+ Cache = nullptr;
+ bool Res = pkgCacheGenerator::MakeStatusCache(*SrcList,Progress,&Map, &Cache, true);
if (Progress != NULL)
Progress->Done();
if (Res == false)
@@ -106,7 +107,8 @@ bool pkgCacheFile::BuildCaches(OpProgress *Progress, bool WithLock)
if (_error->PendingError() == true)
_error->Warning(_("You may want to run apt-get update to correct these problems"));
- Cache = new pkgCache(Map);
+ if (Cache == nullptr)
+ Cache = new pkgCache(Map);
if (_error->PendingError() == true)
return false;
return true;