summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-08-29 23:48:15 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-08-29 23:48:15 +0000
commit002d99439f800af38ee08fb89ef9651db727f36b (patch)
treedb6a4d1d4a42f54c150fc65d2489babfc1b3b2a6 /apt-pkg/acquire-item.cc
parent2237bd010018aedc2c301cd9357eb5ea6affb436 (diff)
* fixed apt-pkg/acquire-item.h (looks like the last commit didn't include it?)
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc53
1 files changed, 26 insertions, 27 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index aab8b7ed1..a1bd2336f 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -220,6 +220,10 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile)
if(TF.Step(Tags) == true)
{
string local_sha1;
+ bool found = false;
+ DiffInfo d;
+ string size;
+
string tmp = Tags.FindS("SHA1-Current");
std::stringstream ss(tmp);
ss >> ServerSha1;
@@ -232,32 +236,27 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile)
if(local_sha1 == ServerSha1) {
if(Debug)
std::clog << "Package file is up-to-date" << std::endl;
- new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
- ExpectedMD5, available_patches);
- Complete = false;
- Status = StatDone;
- Dequeue();
- return true;
- }
- 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);
- DiffInfo d;
- string size;
- bool found = false;
- 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(Debug)
- std::clog << "Need to get diff: " << d.file << std::endl;
- available_patches.push_back(d);
+ // set found to true, this will queue a pkgAcqIndexDiffs with
+ // a empty availabe_patches
+ found = true;
+ } 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) {
+ 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(Debug)
+ std::clog << "Need to get diff: " << d.file << std::endl;
+ available_patches.push_back(d);
+ }
}
}
@@ -287,7 +286,7 @@ void pkgAcqDiffIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
std::clog << "pkgAcqDiffIndex failed: " << Desc.URI << std::endl
<< "Falling back to normal index file aquire" << std::endl;
- new pkgAcqIndex(Owner, RealURI, Description,Desc.ShortDesc,
+ new pkgAcqIndex(Owner, RealURI, Description, Desc.ShortDesc,
ExpectedMD5);
Complete = false;