]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-item.cc
Merge with mainline
[apt.git] / apt-pkg / acquire-item.cc
index de8cfe8f2249e2b74d2aeccd46b93264663bcf94..b2f896627f23e44433c4214c1ab562e4b32efa68 100644 (file)
@@ -340,6 +340,12 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
       // File was already in place.  It needs to be re-verified
       // because Release might have changed, so Move it into partial
       Rename(Final,DestFile);
+      // unlink the file and do not try to use I-M-S and Last-Modified
+      // if the users proxy is broken
+      if(_config->FindB("Acquire::BrokenProxy", false) == true) {
+        std::cerr << "forcing re-get of the signature file as requested" << std::endl;
+        unlink(DestFile.c_str());
+      }
    }
 
    QueueURI(Desc);
@@ -350,18 +356,8 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
 /* The only header we use is the last-modified header. */
 string pkgAcqMetaSig::Custom600Headers()
 {
-   // mvo: we don't really need the last-modified header here
-   //      1) it points to "Final" and that was renamed to "DestFile" 
-   //         so it's never send anyway
-   //      2) because DestFIle is in partial/ we will send a partial request
-   //         with if-range in the http method (or the equivalent for ftp). 
-   //         that should give the same result
-
-   string Final = _config->FindDir("Dir::State::lists");
-   Final += URItoFileName(RealURI);
-   
    struct stat Buf;
-   if (stat(Final.c_str(),&Buf) != 0)
+   if (stat(DestFile.c_str(),&Buf) != 0)
       return "\nIndex-File: true";
 
    return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);