diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-05-09 09:09:12 +0000 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-05-09 09:09:12 +0000 |
commit | 77a7df0e00b10252abb2fe52a083d53d5878ab11 (patch) | |
tree | 104a07616db9646bfd66412b1f456309e9d87fca /apt-pkg | |
parent | 26d276459901fea7209203ec84403bb7934fb869 (diff) |
* another bug in QueueNextDiff fixed
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-item.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index fff55f7b5..79e0b1898 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -290,10 +290,9 @@ bool pkgAcqIndexDiffs::QueueNextDiff() // remove all patches until the next matching patch is found // this requires the Index file to be ordered for(vector<DiffInfo>::iterator I=available_patches.begin(); - (*I).sha1 == local_sha1 || I != available_patches.end(); + 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) { @@ -356,14 +355,17 @@ bool pkgAcqIndexDiffs::ParseIndexDiff(string IndexDiffFile) 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); } } + // no information how to get the patches, bail out if(!found) { if(Debug) |