X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/256f68abcf71157df78ab1aee08e46ff1b4f2b66..5dd4c8b811d9c7bc33e50254811f5bc0fc37f872:/apt-pkg/cachefile.cc?ds=sidebyside diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index cccad2bf3..790312dc8 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -19,10 +19,11 @@ #include #include #include +#include +#include #include /*}}}*/ - // CacheFile::CacheFile - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -47,6 +48,7 @@ pkgCacheFile::~pkgCacheFile() /* */ bool pkgCacheFile::BuildCaches(OpProgress &Progress,bool WithLock) { + const bool ErrorWasEmpty = _error->empty(); if (WithLock == true) if (_system->Lock() == false) return false; @@ -69,7 +71,7 @@ bool pkgCacheFile::BuildCaches(OpProgress &Progress,bool WithLock) return _error->Error(_("The package lists or status file could not be parsed or opened.")); /* This sux, remove it someday */ - if (_error->empty() == false) + if (ErrorWasEmpty == true && _error->empty() == false) _error->Warning(_("You may want to run apt-get update to correct these problems")); Cache = new pkgCache(Map); @@ -90,7 +92,8 @@ bool pkgCacheFile::Open(OpProgress &Progress,bool WithLock) Policy = new pkgPolicy(Cache); if (_error->PendingError() == true) return false; - if (ReadPinFile(*Policy) == false) + + if (ReadPinFile(*Policy) == false || ReadPinDir(*Policy) == false) return false; // Create the dependency cache @@ -106,7 +109,6 @@ bool pkgCacheFile::Open(OpProgress &Progress,bool WithLock) return true; } /*}}}*/ - // CacheFile::Close - close the cache files /*{{{*/ // --------------------------------------------------------------------- /* */