From 1e8b4c0f25c2d719a036e276f963c5182dee01d5 Mon Sep 17 00:00:00 2001
From: Michael Vogt <michael.vogt@ubuntu.com>
Date: Tue, 28 Mar 2006 19:05:42 +0200
Subject: * only show ETA if that makes sense

---
 apt-pkg/acquire.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'apt-pkg')

diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 57cf60bfe..a9a770905 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -818,7 +818,13 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
       unsigned long ETA =
 	 (unsigned long)((TotalBytes - CurrentBytes) / CurrentCPS);
 
-      snprintf(msg,sizeof(msg), _("Downloading file %li of %li (%s remaining)"), i, TotalItems, TimeToStr(ETA).c_str());
+      // only show the ETA if it makes sense
+      if (ETA > 0 && ETA < 172800 /* two days */ )
+	 snprintf(msg,sizeof(msg), _("Downloading file %li of %li (%s remaining)"), i, TotalItems, TimeToStr(ETA).c_str());
+      else
+	 snprintf(msg,sizeof(msg), _("Downloading file %li of %li"), i, TotalItems);
+	 
+
 
       // build the status str
       status << "dlstatus:" << i
-- 
cgit v1.2.3