From 5f0ccad882f7d811e4bea2a7b269f32be2fb1bd9 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 23 Dec 2004 10:02:47 +0000 Subject: * if a sign-file download fails, delete the the partial download in "partial/" also --- apt-pkg/acquire-item.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index f40c6a50d..fcd655f2a 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -392,6 +392,9 @@ 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, -- cgit v1.2.3 From a789b983b99696793857dd58f6d4ea1efe17470e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 23 Dec 2004 11:29:13 +0000 Subject: * changelog updated, version is now 0.6.27ubuntu4; added DEB_BUILD_PROG_OPTS to debian/rules --- apt-pkg/acquire-item.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index fcd655f2a..d1bed417b 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -352,7 +352,7 @@ string pkgAcqMetaSig::Custom600Headers() struct stat Buf; if (stat(Final.c_str(),&Buf) != 0) return "\nIndex-File: true"; - + return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); } @@ -392,8 +392,14 @@ 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()); + + // if we debug leave the sig-file in partial/ to see what went wrong + // else delete it + if (!_config->FindB("Debug::pkgAcquire::Auth", false)) { + + Final = _config->FindDir("Dir::State::lists") + "partial/"+ URItoFileName(RealURI); + unlink(Final.c_str()); + } // queue a pkgAcqMetaIndex with no sigfile -- cgit v1.2.3 From f6237efdccd4b176efddaede6c9d90b8cecc0aa3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 23 Dec 2004 12:08:47 +0000 Subject: * removed Release.gpg files in partial/ before fetching a new one --- apt-pkg/acquire-item.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index d1bed417b..d96ea1ffb 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; @@ -393,15 +397,6 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI); unlink(Final.c_str()); - // if we debug leave the sig-file in partial/ to see what went wrong - // else delete it - if (!_config->FindB("Debug::pkgAcquire::Auth", false)) { - - 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, "", IndexTargets, MetaIndexParser); -- cgit v1.2.3 From 500bd9999c105dfc58013bda69f0a3ac741a21c0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 23 Dec 2004 12:20:59 +0000 Subject: * some comments about the pkgAcqMetaSig::Custom600Headers() added --- apt-pkg/acquire-item.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index d96ea1ffb..de8cfe8f2 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -350,6 +350,13 @@ 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); -- cgit v1.2.3