summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-08-22 08:48:50 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-08-22 08:48:50 +0000
commit59a704f0efe9cf243f1b27ac833558b89728aa9c (patch)
tree101ca1b0a24e8725753ee071f1310e39622c448e /apt-pkg
parent16176b647e76f316ec98f31f6dd806a49d7b8a77 (diff)
* rred.cc: use the d'tor of FileFd to close the file-fd; acquuire-item.cc: make the QueueNextDiff() code more robust
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 166845868..43d29c737 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -218,9 +218,8 @@ string pkgAcqIndexDiffs::Custom600Headers()
void pkgAcqIndexDiffs::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
{
- if(Debug)
- std::clog << "Failed(): " << Desc.URI << std::endl
- << "Falling back to big package file" << std::endl;
+ std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << std::endl
+ << "Falling back to normal index file aquire" << std::endl;
new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc,
ExpectedMD5);
Finish();
@@ -268,9 +267,11 @@ 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 != 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) {
@@ -433,9 +434,11 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long Size,string Md5Hash,
available_patches.erase(available_patches.begin());
// move into place
- if(Debug)
+ if(Debug)
+ {
std::clog << "Moving patched file in place: " << std::endl
<< DestFile << " -> " << FinalFile << std::endl;
+ }
Rename(DestFile,FinalFile);
// see if there is more to download