]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cachefile.cc
rename 'apt-get files' to 'apt-get indextargets'
[apt.git] / apt-pkg / cachefile.cc
index 0fd40106f677b1751d52adb353d0d5e3cefb710f..690776266c96e3d5741688f1b2632fe605300bc8 100644 (file)
@@ -65,8 +65,8 @@ bool pkgCacheFile::BuildCaches(OpProgress *Progress, bool WithLock)
 
    if (_config->FindB("pkgCacheFile::Generate", true) == false)
    {
-      Map = new MMap(*new FileFd(_config->FindFile("Dir::Cache::pkgcache"),
-                    FileFd::ReadOnly),MMap::Public|MMap::ReadOnly);
+      FileFd file(_config->FindFile("Dir::Cache::pkgcache"), FileFd::ReadOnly);
+      Map = new MMap(file, MMap::Public|MMap::ReadOnly);
       Cache = new pkgCache(Map);
       if (_error->PendingError() == true)
          return false;
@@ -143,6 +143,9 @@ bool pkgCacheFile::BuildDepCache(OpProgress *Progress)
    if (DCache != NULL)
       return true;
 
+   if (BuildPolicy(Progress) == false)
+      return false;
+
    DCache = new pkgDepCache(Cache,Policy);
    if (_error->PendingError() == true)
       return false;