X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b0f4b486e6850c5f98520ccf19da71d0ed748ae4..0327b790d40e59e1e35c6ed841308aaebbde8697:/apt-private/private-update.cc?ds=sidebyside

diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc
index 1cf3012ed..1e5d69512 100644
--- a/apt-private/private-update.cc
+++ b/apt-private/private-update.cc
@@ -13,6 +13,7 @@
 
 #include <apt-private/acqprogress.h>
 #include <apt-private/private-cachefile.h>
+#include <apt-private/private-download.h>
 #include <apt-private/private-output.h>
 #include <apt-private/private-update.h>
 
@@ -37,22 +38,15 @@ bool DoUpdate(CommandLine &CmdL)
       return false;
    pkgSourceList *List = Cache.GetSourceList();
 
-   // Create the progress
-   AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
-      
    // Just print out the uris an exit if the --print-uris flag was used
    if (_config->FindB("APT::Get::Print-URIs") == true)
    {
       // force a hashsum for compatibility reasons
       _config->CndSet("Acquire::ForceHash", "md5sum");
 
-      // get a fetcher
-      pkgAcquire Fetcher;
-      if (Fetcher.Setup(&Stat) == false)
-	 return false;
-
-      // Populate it with the source selection and get all Indexes 
+      // Populate it with the source selection and get all Indexes
       // (GetAll=true)
+      aptAcquireWithTextStatus Fetcher;
       if (List->GetIndexes(&Fetcher,true) == false)
 	 return false;
 
@@ -72,7 +66,10 @@ bool DoUpdate(CommandLine &CmdL)
 
    // do the work
    if (_config->FindB("APT::Get::Download",true) == true)
-       ListUpdate(Stat, *List);
+   {
+      AcqTextStatus Stat(std::cout, ScreenWidth,_config->FindI("quiet",0));
+      ListUpdate(Stat, *List);
+   }
 
    // Rebuild the cache.
    if (_config->FindB("pkgCacheFile::Generate", true) == true)
@@ -86,7 +83,8 @@ bool DoUpdate(CommandLine &CmdL)
    if (_config->FindB("APT::Cmd::Show-Update-Stats", false) == true)
    {
       int upgradable = 0;
-      Cache.Open();
+      if (Cache.Open() == false)
+         return false;
       for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I)
       {
          pkgDepCache::StateCache &state = Cache[I];