]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cachefile.cc
provide a constexpr char[] overload for APT::StringView
[apt.git] / apt-pkg / cachefile.cc
index 39f1e72dbb5396a205be0b0c1e3b39113fcdc8eb..92a3b201bb8524f9f3e4f0252cd8ef70f7928387 100644 (file)
@@ -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;