From 29ba053e05b1a496500036dbd667002d1b8b5ec2 Mon Sep 17 00:00:00 2001 From: Matt Zimmerman Date: Sun, 26 Jun 2005 21:30:27 +0000 Subject: Merge with mvo Patches applied: * michael.vogt@ubuntu.com--2005/apt--bts225947--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-79 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-1 * merged with mainline and apt--fixes--0 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-2 * patch from aj (slighly modified to use auto_ptr<>) applied * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-3 * changelog updated * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-4 * work for arch=all packages too now * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-5 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-7 * fixed incorrect man-page example * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-8 * changelog udpate * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-87 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-1 * report timeouts (from Connect) and fail if they happen in pkgAcqMetaSig * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-2 * merged with the fixes branch to make it build again * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-1 tag of apt@packages.debian.org/apt--main--0--patch-88 * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-2 * merged apt--mvo (to make pining on components work again) * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-3 * merged with apt--fixes--0 (to make the building of the french manpages work and to fix a incorrect man-page example * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-4 * merged with the bts225947 code * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-5 * merged the imporoved timoeut handling patch * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-6 * merged with matt * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-7 * removed another conflict with apt--main --- apt-pkg/acquire-item.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index b2f896627..14acad85a 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -400,6 +400,12 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI); unlink(Final.c_str()); + // if we get a timeout if fail + if(LookupTag(Message,"FailReason") == "Timeout") { + Item::Failed(Message,Cnf); + return; + } + // queue a pkgAcqMetaIndex with no sigfile new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc, "", IndexTargets, MetaIndexParser); -- cgit v1.2.3 From b4e57d2dd44728929cb83113ed79c8e16405767e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 30 Nov 2005 13:53:44 +0000 Subject: * hack around local file:/ uri problem --- apt-pkg/acquire-item.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 8a9a4c5bb..ad977dde4 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -165,11 +165,15 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner, CurrentPackagesFile = _config->FindDir("Dir::State::lists"); CurrentPackagesFile += URItoFileName(RealURI); + // FIXME: this file:/ check is a hack to prevent fetching + // from local sources. this is really silly, and + // should be fixed cleanly as soon as possible if(!FileExists(CurrentPackagesFile) || + Desc.URI.substr(0,strlen("file:/")) == "file:/" || !_config->FindB("Acquire::Diffs",true)) { // we don't have a pkg file or we don't want to queue if(Debug) - std::clog << "No index file or canceld by user" << std::endl; + std::clog << "No index file, local or canceld by user" << std::endl; Failed("", NULL); return; } -- cgit v1.2.3 From 7a6058744badb38d2ccac0158d6ed1359cfb0239 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 8 Dec 2005 17:29:42 +0000 Subject: * merged with the current debian version Patches applied: * bubulle@debian.org--2005/apt--main--0--patch-132 Completed Simplified Chinese translation * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-94 * pkgDirStream has (slightly) better extract support now * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-95 * merge fix for #339533 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-96 * merged with bubulle * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-97 * some more debug output * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-98 * ABI change: merged more flexible pkgAcquireFile code * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-99 * merged http download limit for apt (#146877) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-100 * applied parts of the string speedup patch from debian #319377 (ABI change) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-101 * fix for #340448 --- apt-pkg/acquire-item.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 09f25c0dd..88c25de43 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -142,20 +142,21 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, { Decompression = false; Erase = false; - + DestFile = _config->FindDir("Dir::State::lists") + "partial/"; DestFile += URItoFileName(URI); if(comprExt.empty()) { - // autoselect - if(FileExists("/usr/bin/bzip2")) - Desc.URI = URI + ".bz2"; - else - Desc.URI = URI + ".gz"; + // autoselect the compression method + if(FileExists("/usr/bin/bzip2")) + CompressionExtension = ".bz2"; + else + CompressionExtension = ".gz"; } else { - Desc.URI = URI + comprExt; + CompressionExtension = comprExt; } + Desc.URI = URI + CompressionExtension; Desc.Description = URIDesc; Desc.Owner = this; -- cgit v1.2.3 From 47eb38f452c7477aab782dce56e85a0a85e22764 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 21 Feb 2006 12:23:22 +0000 Subject: * handle network failures more gracefully (default apt sources spec) apt-pkg/acquire-item.cc: - on network failures (Timeout,ResolveFailure,ConnectionRefused) move the old (known good) sigfile back and don't touch the indexfiles cmdline/apt-get.cc: - don't fail on apt-get update problems but issue a warning instead --- apt-pkg/acquire-item.cc | 10 +++++++--- 1 file changed, 7 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 1fa929aad..dee00c63e 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -321,8 +321,9 @@ 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 + // remove any partial downloaded sig-file in partial/. + // it may confuse proxies and is too small to warrant a + // partial download anyway unlink(DestFile.c_str()); // Create the item @@ -389,17 +390,20 @@ void pkgAcqMetaSig::Done(string Message,unsigned long Size,string MD5, /*}}}*/ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) { + string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI); // if we get a network error we fail gracefully if(LookupTag(Message,"FailReason") == "Timeout" || LookupTag(Message,"FailReason") == "TmpResolveFailure" || LookupTag(Message,"FailReason") == "ConnectionRefused") { Item::Failed(Message,Cnf); + // move the sigfile back on network failures (and re-authenticated?) + if(FileExists(DestFile)) + Rename(DestFile,Final); return; } // Delete any existing sigfile when the acquire failed - string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI); unlink(Final.c_str()); // queue a pkgAcqMetaIndex with no sigfile -- cgit v1.2.3 From 7e5f33eb8a0f224b938f17236f684ba5cadb9c7f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 21 Feb 2006 16:39:25 +0000 Subject: * more work for the DefaultAptSources spec apt-pkg/acquire-item.h: - add new pkgAcquire::Item::StatTransientNetworkError status apt-pkg/acquire-item.cc: - if we get a StatTransientNetworkError use old sigfile and indexfiles apt-pkg/acquire-worker.cc: - set StatTransientNetworkError on "Timeout", "TmpResolveFailure", "ConnectionRefused" cmdline/apt-get.cc: - handle a StatTransientNetworkError different than a normal error (warning instead of error) --- apt-pkg/acquire-item.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index dee00c63e..da9becc44 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -75,7 +75,7 @@ void pkgAcquire::Item::Failed(string Message,pkgAcquire::MethodConfig *Cnf) Dequeue(); return; } - + Status = StatError; Dequeue(); } @@ -393,13 +393,15 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI); // if we get a network error we fail gracefully - if(LookupTag(Message,"FailReason") == "Timeout" || - LookupTag(Message,"FailReason") == "TmpResolveFailure" || - LookupTag(Message,"FailReason") == "ConnectionRefused") { + if(Status == StatTransientNetworkError) + { Item::Failed(Message,Cnf); // move the sigfile back on network failures (and re-authenticated?) if(FileExists(DestFile)) Rename(DestFile,Final); + + // set the status back to , Item::Failed likes to reset it + Status = pkgAcquire::Item::StatTransientNetworkError; return; } -- cgit v1.2.3 From 2ac3eeb60e9ea171cee7a05a02424e61fe50d400 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 30 Mar 2006 10:38:14 +0200 Subject: * make the code follow the apt coding standards better * change the location to turn off pdiff (APT::PDiff=false) --- apt-pkg/acquire-item.cc | 61 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 20 deletions(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index ad977dde4..d845d4605 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -170,7 +170,8 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner, // should be fixed cleanly as soon as possible if(!FileExists(CurrentPackagesFile) || Desc.URI.substr(0,strlen("file:/")) == "file:/" || - !_config->FindB("Acquire::Diffs",true)) { + !_config->FindB("Acquire::Diffs",true)) + { // we don't have a pkg file or we don't want to queue if(Debug) std::clog << "No index file, local or canceld by user" << std::endl; @@ -178,11 +179,10 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner, return; } - if(Debug) { + if(Debug) std::clog << "pkgAcqIndexDiffs::pkgAcqIndexDiffs(): " << CurrentPackagesFile << std::endl; - } - + QueueURI(Desc); } @@ -237,26 +237,32 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) SHA1.AddFD(fd.Fd(), fd.Size()); local_sha1 = string(SHA1.Result()); - if(local_sha1 == ServerSha1) { + if(local_sha1 == ServerSha1) + { + // we have the same sha1 as the server if(Debug) std::clog << "Package file is up-to-date" << std::endl; // set found to true, this will queue a pkgAcqIndexDiffs with // a empty availabe_patches found = true; - } else { + } + else + { if(Debug) std::clog << "SHA1-Current: " << ServerSha1 << std::endl; // check the historie and see what patches we need string history = Tags.FindS("SHA1-History"); std::stringstream hist(history); - while(hist >> d.sha1 >> size >> d.file) { + while(hist >> d.sha1 >> size >> d.file) + { d.size = atoi(size.c_str()); // read until the first match is found if(d.sha1 == local_sha1) found=true; // from that point on, we probably need all diffs - if(found) { + if(found) + { if(Debug) std::clog << "Need to get diff: " << d.file << std::endl; available_patches.push_back(d); @@ -265,12 +271,15 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) } // no information how to get the patches, bail out - if(!found) { + if(!found) + { if(Debug) std::clog << "Can't find a patch in the index file" << std::endl; // Failed will queue a big package file Failed("", NULL); - } else { + } + else + { // queue the diffs new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc, ExpectedMD5, available_patches); @@ -351,10 +360,13 @@ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner, Desc.Owner = this; Desc.ShortDesc = ShortDesc; - if(available_patches.size() == 0) { + if(available_patches.size() == 0) + { // we are done (yeah!) Finish(true); - } else { + } + else + { // get the next diff State = StateFetchDiff; QueueNextDiff(); @@ -378,7 +390,8 @@ void pkgAcqIndexDiffs::Finish(bool allDone) { // we restore the original name, this is required, otherwise // the file will be cleaned - if(allDone) { + if(allDone) + { DestFile = _config->FindDir("Dir::State::lists"); DestFile += URItoFileName(RealURI); @@ -435,14 +448,17 @@ bool pkgAcqIndexDiffs::QueueNextDiff() // remove all patches until the next matching patch is found // this requires the Index file to be ordered for(vector::iterator I=available_patches.begin(); - available_patches.size() > 0 && I != available_patches.end() - && (*I).sha1 != local_sha1; - I++) { + available_patches.size() > 0 && + I != available_patches.end() && + (*I).sha1 != local_sha1; + I++) + { available_patches.erase(I); } // error checking and falling back if no patch was found - if(available_patches.size() == 0) { + if(available_patches.size() == 0) + { Failed("", NULL); return false; } @@ -1009,9 +1025,14 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) } } - // Queue Packages file - new pkgAcqDiffIndex(Owner, (*Target)->URI, (*Target)->Description, - (*Target)->ShortDesc, ExpectedIndexMD5); + // Queue Packages file (either diff or full packages files, depending + // on the users option) + if(_config->FindB("Acquire::PDiffs",false) == false) + new pkgAcqDiffIndex(Owner, (*Target)->URI, (*Target)->Description, + (*Target)->ShortDesc, ExpectedIndexMD5); + else + new newPkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description, + (*Target)->ShortDesc, ExpectedIndexMD5); } } -- cgit v1.2.3 From 81fcf9e22b9f93896ceb644c9341d9d53da9c790 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 30 Mar 2006 10:52:32 +0200 Subject: * fix FTBFS --- apt-pkg/acquire-item.cc | 5 ++--- 1 file changed, 2 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 d845d4605..38977d2b1 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -169,8 +169,7 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner, // from local sources. this is really silly, and // should be fixed cleanly as soon as possible if(!FileExists(CurrentPackagesFile) || - Desc.URI.substr(0,strlen("file:/")) == "file:/" || - !_config->FindB("Acquire::Diffs",true)) + Desc.URI.substr(0,strlen("file:/")) == "file:/") { // we don't have a pkg file or we don't want to queue if(Debug) @@ -1031,7 +1030,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) new pkgAcqDiffIndex(Owner, (*Target)->URI, (*Target)->Description, (*Target)->ShortDesc, ExpectedIndexMD5); else - new newPkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description, + new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description, (*Target)->ShortDesc, ExpectedIndexMD5); } } -- cgit v1.2.3 From 8f30ca302e4235985982a0f2b1e83dfe977ed12c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 2 Apr 2006 13:02:02 +0200 Subject: * fix in the log class to avoid absurdely big downloads --- apt-pkg/acquire-item.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 38977d2b1..a29063e1a 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -103,7 +103,8 @@ void pkgAcquire::Item::Done(string Message,unsigned long Size,string, { // We just downloaded something.. string FileName = LookupTag(Message,"Filename"); - if (Complete == false && FileName == DestFile) + // we only inform the Log class if it was actually not a local thing + if (Complete == false && !Local && FileName == DestFile) { if (Owner->Log != 0) Owner->Log->Fetched(Size,atoi(LookupTag(Message,"Resume-Point","0").c_str())); -- cgit v1.2.3 From b7347826732bfad84001555d51f57b99017dd8c4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 2 Apr 2006 13:10:49 +0200 Subject: * apt-pkg/acquire-item.cc: pdiff unzip+rred stuff is Local=true --- apt-pkg/acquire-item.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index a29063e1a..c1f6767c0 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -500,6 +500,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long Size,string Md5Hash, string FileName = LookupTag(Message,"Filename"); State = StateUnzipDiff; + Local = true; Desc.URI = "gzip:" + FileName; DestFile += ".decomp"; QueueURI(Desc); @@ -518,6 +519,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long Size,string Md5Hash, std::clog << "Sending to rred method: " << FinalFile << std::endl; State = StateApplyDiff; + Local = true; Desc.URI = "rred:" + FinalFile; QueueURI(Desc); Mode = "rred"; -- cgit v1.2.3 From 27299daff7e00d561dabb92945a516ed34b7be47 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 11 May 2006 12:08:40 +0200 Subject: * apt-pkg/acquire-item.cc: - make Acquire::PDiffs=true get pdfiffs, =false not get them --- apt-pkg/acquire-item.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index c1f6767c0..f22daaf71 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1029,7 +1029,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) // Queue Packages file (either diff or full packages files, depending // on the users option) - if(_config->FindB("Acquire::PDiffs",false) == false) + if(_config->FindB("Acquire::PDiffs",true) == true) new pkgAcqDiffIndex(Owner, (*Target)->URI, (*Target)->Description, (*Target)->ShortDesc, ExpectedIndexMD5); else -- cgit v1.2.3 From 1790e0cf6a14ba2a3ccd8a8a926ca12a44d46d97 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 14 Jun 2006 11:59:47 +0200 Subject: * apt-pkg/acquire-item.cc: - added missing chmod() calls, thanks to Bastian Blank --- apt-pkg/acquire-item.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index f22daaf71..a51b6f12d 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -540,6 +540,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long Size,string Md5Hash, << DestFile << " -> " << FinalFile << std::endl; } Rename(DestFile,FinalFile); + chmod(FinalFile.c_str(),0644); // see if there is more to download if(available_patches.size() > 0) { @@ -958,6 +959,7 @@ void pkgAcqMetaIndex::RetrievalDone(string Message) // Move it into position Rename(DestFile,FinalFile); } + chmod(FinalFile.c_str(),0644); DestFile = FinalFile; } -- cgit v1.2.3 From 7106240056767caad5a55fe9c542842065cb5829 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 7 Dec 2006 11:10:32 +0100 Subject: * apt-pkg/acquire-item.cc: - merged the NMU pdiff fix and make the code a bit more readable --- apt-pkg/acquire-item.cc | 16 +++++++--------- 1 file changed, 7 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 a51b6f12d..6831abd54 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -270,15 +270,8 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) } } - // no information how to get the patches, bail out - if(!found) - { - if(Debug) - std::clog << "Can't find a patch in the index file" << std::endl; - // Failed will queue a big package file - Failed("", NULL); - } - else + // we have something, queue the next diff + if(found) { // queue the diffs new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc, @@ -290,6 +283,11 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) } } + // Nothing found, report and return false + // Failing here is ok, if we return false later, the full + // IndexFile is queued + if(Debug) + std::clog << "Can't find a patch in the index file" << std::endl; return false; } -- cgit v1.2.3 From 14443594b5fdd5a99cb94434bddfbae098e83ecd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 7 Dec 2006 14:42:57 +0100 Subject: * apt-pkg/acquire-item.cc - more usefull description of the downloaded patches --- apt-pkg/acquire-item.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 46c9d6c2c..0419f5ffd 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -274,6 +274,9 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) if(found) { // queue the diffs + int last_space = Description.rfind(" "); + if(last_space != string::npos) + Description.erase(last_space, Description.size()-last_space); new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc, ExpectedMD5, available_patches); Complete = false; @@ -354,7 +357,7 @@ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner, Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); - Desc.Description = URIDesc; + Description = URIDesc; Desc.Owner = this; Desc.ShortDesc = ShortDesc; @@ -463,7 +466,7 @@ bool pkgAcqIndexDiffs::QueueNextDiff() // queue the right diff Desc.URI = string(RealURI) + ".diff/" + available_patches[0].file + ".gz"; - Desc.Description = available_patches[0].file + string(".pdiff"); + Desc.Description = Description + " " + available_patches[0].file + string(".pdiff"); DestFile = _config->FindDir("Dir::State::lists") + "partial/"; DestFile += URItoFileName(RealURI + ".diff/" + available_patches[0].file); -- cgit v1.2.3