X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/5f0ccad882f7d811e4bea2a7b269f32be2fb1bd9..2aab5956ebcaec3aa6c71f069a202366c872bb87:/apt-pkg/acquire-item.cc diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index fcd655f2a..714edd8d8 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -321,6 +321,10 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner, DestFile = _config->FindDir("Dir::State::lists") + "partial/"; DestFile += URItoFileName(URI); + // remove any partial downloaded sig-file. it may confuse proxies + // and is too small to warrant a partial download anyway + unlink(DestFile.c_str()); + // Create the item Desc.Description = URIDesc; Desc.Owner = this; @@ -346,13 +350,10 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner, /* The only header we use is the last-modified header. */ string pkgAcqMetaSig::Custom600Headers() { - 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); } @@ -392,9 +393,6 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) // mistakenly trusted string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI); unlink(Final.c_str()); - Final = _config->FindDir("Dir::State::lists") + "partial/"+ URItoFileName(RealURI); - unlink(Final.c_str()); - // queue a pkgAcqMetaIndex with no sigfile new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,