summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.h
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-14 17:29:23 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-14 17:29:23 +0200
commitc21843144a444dfecf77a47933a9b9ec07870c1e (patch)
tree7ccb59047b2da6c3f483ad812fe871932703951f /apt-pkg/acquire-item.h
parent0cf3962923bd26b11d738b0b403d92be60123bd1 (diff)
Pass struct IndexTarget/indexRecords to pkgAcqIndex{,Merge}Diffs
If one of the pkgAcqIndex{,Merge}Diffs fails, they will run pkgAcqIndex() which needs the IndexTarget/indexRecords data. So we pass it along.
Diffstat (limited to 'apt-pkg/acquire-item.h')
-rw-r--r--apt-pkg/acquire-item.h43
1 files changed, 36 insertions, 7 deletions
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index eab5bb222..7219e8047 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -367,6 +367,18 @@ class pkgAcqSubIndex : public pkgAcquire::Item
std::string const &ShortDesc, HashString const &ExpectedHash);
};
/*}}}*/
+
+class pkgAcqBaseIndex : public pkgAcquire::Item
+{
+ protected:
+ /** \brief Pointer to the IndexTarget data
+ */
+ const struct IndexTarget * Target;
+ indexRecords *MetaIndexParser;
+
+
+};
+
/** \brief An item that is responsible for fetching an index file of {{{
* package list diffs and starting the package list's download.
*
@@ -509,6 +521,11 @@ class pkgAcqIndexMergeDiffs : public pkgAcquire::Item
StateErrorDiff
} State;
+ /** \brief Pointer to the IndexTarget data
+ */
+ const struct IndexTarget * Target;
+ indexRecords *MetaIndexParser;
+
public:
/** \brief Called when the patch file failed to be downloaded.
*
@@ -542,9 +559,12 @@ class pkgAcqIndexMergeDiffs : public pkgAcquire::Item
* \param allPatches contains all related items so that each item can
* check if it was the last one to complete the download step
*/
- pkgAcqIndexMergeDiffs(pkgAcquire *Owner,std::string const &URI,std::string const &URIDesc,
- std::string const &ShortDesc, HashString const &ExpectedHash,
- DiffInfo const &patch, std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches);
+ pkgAcqIndexMergeDiffs(pkgAcquire *Owner,
+ struct IndexTarget const * const Target,
+ HashString ExpectedHash,
+ indexRecords *MetaIndexParser,
+ DiffInfo const &patch,
+ std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches);
};
/*}}}*/
/** \brief An item that is responsible for fetching server-merge patches {{{
@@ -640,6 +660,11 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
StateApplyDiff
} State;
+ /** \brief Pointer to the IndexTarget data
+ */
+ const struct IndexTarget * Target;
+ indexRecords *MetaIndexParser;
+
public:
/** \brief Called when the patch file failed to be downloaded.
@@ -677,8 +702,10 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
* should be ordered so that each diff appears before any diff
* that depends on it.
*/
- pkgAcqIndexDiffs(pkgAcquire *Owner,std::string URI,std::string URIDesc,
- std::string ShortDesc, HashString ExpectedHash,
+ pkgAcqIndexDiffs(pkgAcquire *Owner,
+ struct IndexTarget const * const Target,
+ HashString ExpectedHash,
+ indexRecords *MetaIndexParser,
std::string ServerSha1,
std::vector<DiffInfo> diffs=std::vector<DiffInfo>());
};
@@ -767,8 +794,10 @@ class pkgAcqIndex : public pkgAcquire::Item
pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
std::string ShortDesc, HashString ExpectedHash,
std::string compressExt="");
- pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
- HashString const &ExpectedHash, indexRecords *MetaIndexParser);
+ pkgAcqIndex(pkgAcquire *Owner,
+ struct IndexTarget const * const Target,
+ HashString const &ExpectedHash,
+ indexRecords *MetaIndexParser);
void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
};
/*}}}*/