X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8508b1df3743c016f3f3aa82d63672378a113cac..d82d687380b0a7f884f531d3cce5d0fa945d9777:/cmdline/acqprogress.cc?ds=sidebyside diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index 556b8869b..e2ef83501 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acqprogress.cc,v 1.17 1999/08/04 05:37:18 jgg Exp $ +// $Id: acqprogress.cc,v 1.20 2000/05/12 04:03:27 jgg Exp $ /* ###################################################################### Acquire Progress - Command line progress meter @@ -93,6 +93,7 @@ void AcqTextStatus::Fail(pkgAcquire::ItemDesc &Itm) if (Quiet > 1) return; + // Ignore certain kinds of transient failures (bad code) if (Itm.Owner->Status == pkgAcquire::Item::StatIdle) return; @@ -123,7 +124,7 @@ void AcqTextStatus::Stop() return; if (Quiet <= 0) - cout << '\r' << BlankLine << '\r'; + cout << '\r' << BlankLine << '\r' << flush; if (FetchedBytes != 0 && _error->PendingError() == false) cout << "Fetched " << SizeToStr(FetchedBytes) << "B in " << @@ -145,10 +146,12 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) enum {Long = 0,Medium,Short} Mode = Long; - char Buffer[300]; + char Buffer[1024]; char *End = Buffer + sizeof(Buffer); char *S = Buffer; - + if (ScreenWidth >= sizeof(Buffer)) + ScreenWidth = sizeof(Buffer)-1; + // Put in the percent done sprintf(S,"%ld%%",long(double((CurrentBytes + CurrentItems)*100.0)/double(TotalBytes+TotalItems)));