X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/cce08fb5aca7dd01706cecea845b183dc62b1717..9c2c9c24f7027a0299e545e55c38ac4c557359a5:/apt-pkg/cachefile.cc 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 /*{{{*/ // --------------------------------------------------------------------- /* */