]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire.cc
* apt-pkg/acquire.cc:
[apt.git] / apt-pkg / acquire.cc
index e1dccf25ab1372b347b004f313403691c7dfbb8a..c1f6581e2c4cb066572309e355797c8c4ad9d670 100644 (file)
@@ -13,9 +13,6 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/acquire.h"
-#endif       
 #include <apt-pkg/acquire.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/acquire-worker.h>
@@ -27,7 +24,8 @@
 
 #include <iostream>
 #include <sstream>
-    
+#include <stdio.h>
+
 #include <dirent.h>
 #include <sys/time.h>
 #include <errno.h>
@@ -268,7 +266,7 @@ pkgAcquire::MethodConfig *pkgAcquire::GetConfig(string Access)
       return 0;
 
    /* if a method uses DownloadLimit, we switch to SingleInstance mode */
-   if(_config->FindI("Acquire::"+Access+"::DlLimit",0) > 0)
+   if(_config->FindI("Acquire::"+Access+"::Dl-Limit",0) > 0)
       Conf->SingleInstance = true;
     
    return Conf;
@@ -447,8 +445,9 @@ bool pkgAcquire::Clean(string Dir)
         unlink(Dir->d_name);
    };
    
-   chdir(StartDir.c_str());
    closedir(D);
+   if (chdir(StartDir.c_str()) != 0)
+      return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str());
    return true;   
 }
                                                                        /*}}}*/
@@ -622,7 +621,7 @@ bool pkgAcquire::Queue::Startup()
          added other source retry to have cycle maintain a pipeline depth
          on its own. */
       if (Cnf->Pipeline == true)
-        MaxPipeDepth = 10;
+        MaxPipeDepth = _config->FindI("Acquire::Max-Pipeline-Depth",10);
       else
         MaxPipeDepth = 1;
    }
@@ -799,7 +798,7 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
    // Compute the CPS
    struct timeval NewTime;
    gettimeofday(&NewTime,0);
-   if (NewTime.tv_sec - Time.tv_sec == 6 && NewTime.tv_usec > Time.tv_usec ||
+   if ((NewTime.tv_sec - Time.tv_sec == 6 && NewTime.tv_usec > Time.tv_usec) ||
        NewTime.tv_sec - Time.tv_sec > 6)
    {    
       double Delta = NewTime.tv_sec - Time.tv_sec +