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') 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-70-g09d2 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') 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-70-g09d2