summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-14 17:47:20 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-14 17:47:20 +0200
commit0b58b3f8917a49d83154fd3173bca36c1d617ef0 (patch)
treeb5456616d3b734884afc0b3ed875eda39789f274 /apt-pkg/acquire-item.cc
parentc21843144a444dfecf77a47933a9b9ec07870c1e (diff)
Add new pkgAcqBaseIndex as base class for pkgAcq{DiffIndex,IndexMerge,pkgAcqBaseIndex, pkgAcqIndex}
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 4d9f5cd00..b3d67de2c 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -346,9 +346,7 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner,
IndexTarget const *Target,
HashString ExpectedHash,
indexRecords *MetaIndexParser)
- : Item(Owner), ExpectedHash(ExpectedHash), Target(Target),
- MetaIndexParser(MetaIndexParser)
-
+ : pkgAcqBaseIndex(Owner, Target, ExpectedHash, MetaIndexParser)
{
Debug = _config->FindB("Debug::pkgAcquire::Diffs",false);
@@ -616,9 +614,8 @@ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
indexRecords *MetaIndexParser,
string ServerSha1,
vector<DiffInfo> diffs)
- : Item(Owner), ExpectedHash(ExpectedHash),
- available_patches(diffs), ServerSha1(ServerSha1),
- Target(Target), MetaIndexParser(MetaIndexParser)
+ : pkgAcqBaseIndex(Owner, Target, ExpectedHash, MetaIndexParser),
+ available_patches(diffs), ServerSha1(ServerSha1)
{
DestFile = _config->FindDir("Dir::State::lists") + "partial/";
@@ -805,9 +802,8 @@ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire *Owner,
indexRecords *MetaIndexParser,
DiffInfo const &patch,
std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches)
- : Item(Owner), ExpectedHash(ExpectedHash), patch(patch),
- allPatches(allPatches), State(StateFetchDiff),
- Target(Target), MetaIndexParser(MetaIndexParser)
+ : pkgAcqBaseIndex(Owner, Target, ExpectedHash, MetaIndexParser),
+ patch(patch), allPatches(allPatches), State(StateFetchDiff)
{
DestFile = _config->FindDir("Dir::State::lists") + "partial/";
@@ -932,8 +928,7 @@ void pkgAcqIndexMergeDiffs::Done(string Message,unsigned long long Size,string M
pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
string URI,string URIDesc,string ShortDesc,
HashString ExpectedHash, string comprExt)
- : Item(Owner), RealURI(URI), ExpectedHash(ExpectedHash), Target(0),
- MetaIndexParser(0)
+ : pkgAcqBaseIndex(Owner, NULL, ExpectedHash, NULL), RealURI(URI)
{
if(comprExt.empty() == true)
{
@@ -952,7 +947,8 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
}
pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, IndexTarget const *Target,
HashString const &ExpectedHash, indexRecords *MetaIndexParser)
- : Item(Owner), RealURI(Target->URI), ExpectedHash(ExpectedHash)
+ : pkgAcqBaseIndex(Owner, Target, ExpectedHash, MetaIndexParser),
+ RealURI(Target->URI)
{
// autoselect the compression method
std::vector<std::string> types = APT::Configuration::getCompressionTypes();
@@ -978,10 +974,6 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, IndexTarget const *Target,
else
Verify = true;
- // we need this in Init()
- this->Target = Target;
- this->MetaIndexParser = MetaIndexParser;
-
Init(Target->URI, Target->Description, Target->ShortDesc);
}
/*}}}*/