summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-06-09 02:03:49 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-06-09 02:03:49 +0200
commit47026cdea6ba7d145922ce21d5ec478598126b8d (patch)
treece174fb35ed7266a2d123c7bf8883463ab04d603 /apt-pkg
parentfb2894d268d4821e0dd4f2b803ff2043b1ec3162 (diff)
parentf32484472374cb6c93fef0cd4ee9f71a7b80ec8a (diff)
* add "purge" commandline argument, closes: #133421)
(thanks to Julien Danjou for the patch) * Removed the more leftover #pragma interface/implementation closes: #306937 (thanks to Andreas Henriksson for the patch)
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc27
-rw-r--r--apt-pkg/algorithms.cc1
2 files changed, 14 insertions, 14 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 3d05e62ae..1b9120586 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -267,17 +267,13 @@ 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
+ 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;
@@ -286,7 +282,12 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile)
return true;
}
}
-
+
+ // 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;
}
@@ -353,7 +354,7 @@ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
Debug = _config->FindB("Debug::pkgAcquire::Diffs",false);
- Desc.Description = URIDesc;
+ Description = URIDesc;
Desc.Owner = this;
Desc.ShortDesc = ShortDesc;
@@ -462,8 +463,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);
@@ -602,7 +602,6 @@ string pkgAcqIndex::Custom600Headers()
void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
{
-
// no .bz2 found, retry with .gz
if(Desc.URI.substr(Desc.URI.size()-3) == "bz2") {
Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz";
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 3f018917c..b21fcbb2f 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -22,6 +22,7 @@
#include <apti18n.h>
+#include <sys/types.h>
#include <cstdlib>
#include <algorithm>
#include <iostream>