]> git.saurik.com Git - apt.git/blobdiff - apt-private/acqprogress.cc
refactor key removal code to reuse it in next step
[apt.git] / apt-private / acqprogress.cc
index d08ed072f442a743d69c4cb66c73dacb2668d242..17a12799cf6dbb0430677af5b99fc337af3d5fb5 100644 (file)
 // Include files                                                       /*{{{*/
 #include<config.h>
 
+#include <apt-pkg/acquire.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/acquire-worker.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/error.h>
 
+#include <apt-private/acqprogress.h>
+
+#include <string.h>
 #include <stdio.h>
 #include <signal.h>
 #include <iostream>
 #include <unistd.h>
 
-#include "acqprogress.h"
 #include <apti18n.h>
                                                                        /*}}}*/
 
@@ -61,8 +64,6 @@ void AcqTextStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
       cout << '\r' << BlankLine << '\r';
 
    cout << _("Hit ") << Itm.Description;
-   if (Itm.Owner->FileSize != 0)
-      cout << " [" << SizeToStr(Itm.Owner->FileSize) << "B]";
    cout << endl;
    Update = true;
 }
@@ -139,6 +140,9 @@ void AcqTextStatus::Stop()
    if (Quiet <= 0)
       cout << '\r' << BlankLine << '\r' << flush;
 
+   if (_config->FindB("quiet::NoStatistic", false) == true)
+      return;
+
    if (FetchedBytes != 0 && _error->PendingError() == false)
       ioprintf(cout,_("Fetched %sB in %s (%sB/s)\n"),
               SizeToStr(FetchedBytes).c_str(),
@@ -167,7 +171,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
       ScreenWidth = sizeof(Buffer)-1;
 
    // Put in the percent done
-   sprintf(S,"%.0f%%",((CurrentBytes + CurrentItems)*100.0)/(TotalBytes+TotalItems));
+   sprintf(S,"%.0f%%", Percent);
 
    bool Shown = false;
    for (pkgAcquire::Worker *I = Owner->WorkersBegin(); I != 0;
@@ -264,7 +268,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
    else
       cout << '\r' << BlankLine << '\r' << Buffer << flush;
    if (_config->FindB("Apt::Color", false) == true)
-      cout << _config->Find("APT::Color::Neutral");
+      cout << _config->Find("APT::Color::Neutral") << flush;
 
    memset(BlankLine,' ',strlen(Buffer));
    BlankLine[strlen(Buffer)] = 0;