]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cachefile.cc
Fix typo
[apt.git] / apt-pkg / cachefile.cc
index cccad2bf3ae95ec29f7bd8035c981cdf80721319..790312dc8d88d849c89887d20dd1db070fce0558 100644 (file)
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/policy.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/policy.h>
 #include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/fileutl.h>
     
 #include <apti18n.h>
                                                                        /*}}}*/
     
 #include <apti18n.h>
                                                                        /*}}}*/
-
 // CacheFile::CacheFile - Constructor                                  /*{{{*/
 // ---------------------------------------------------------------------
 /* */
 // CacheFile::CacheFile - Constructor                                  /*{{{*/
 // ---------------------------------------------------------------------
 /* */
@@ -47,6 +48,7 @@ pkgCacheFile::~pkgCacheFile()
 /* */
 bool pkgCacheFile::BuildCaches(OpProgress &Progress,bool WithLock)
 {
 /* */
 bool pkgCacheFile::BuildCaches(OpProgress &Progress,bool WithLock)
 {
+   const bool ErrorWasEmpty = _error->empty();
    if (WithLock == true)
       if (_system->Lock() == false)
         return false;
    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 */
       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);
       _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;
    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
       return false;
    
    // Create the dependency cache
@@ -106,7 +109,6 @@ bool pkgCacheFile::Open(OpProgress &Progress,bool WithLock)
    return true;
 }
                                                                        /*}}}*/
    return true;
 }
                                                                        /*}}}*/
-
 // CacheFile::Close - close the cache files                            /*{{{*/
 // ---------------------------------------------------------------------
 /* */
 // CacheFile::Close - close the cache files                            /*{{{*/
 // ---------------------------------------------------------------------
 /* */