]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire.cc
* cmdline/apt-mark:
[apt.git] / apt-pkg / acquire.cc
index 62209e65b2140907cc3af428b7482037a62b44e3..fff1b2b6ad379b28603de987933b4523dc5c3f36 100644 (file)
@@ -266,7 +266,11 @@ pkgAcquire::MethodConfig *pkgAcquire::GetConfig(string Access)
    Worker Work(Conf);
    if (Work.Start() == false)
       return 0;
    Worker Work(Conf);
    if (Work.Start() == false)
       return 0;
-   
+
+   /* if a method uses DownloadLimit, we switch to SingleInstance mode */
+   if(_config->FindI("Acquire::"+Access+"::DlLimit",0) > 0)
+      Conf->SingleInstance = true;
+    
    return Conf;
 }
                                                                        /*}}}*/
    return Conf;
 }
                                                                        /*}}}*/
@@ -814,7 +818,13 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
       unsigned long ETA =
         (unsigned long)((TotalBytes - CurrentBytes) / CurrentCPS);
 
       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), _("Retrieving file %li of %li (%s remaining)"), i, TotalItems, TimeToStr(ETA).c_str());
+      else
+        snprintf(msg,sizeof(msg), _("Retrieving file %li of %li"), i, TotalItems);
+        
+
 
       // build the status str
       status << "dlstatus:" << i
 
       // build the status str
       status << "dlstatus:" << i