From c21843144a444dfecf77a47933a9b9ec07870c1e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 14 May 2014 17:29:23 +0200 Subject: 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. --- apt-pkg/acquire-item.h | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'apt-pkg/acquire-item.h') 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 const * const allPatches); + pkgAcqIndexMergeDiffs(pkgAcquire *Owner, + struct IndexTarget const * const Target, + HashString ExpectedHash, + indexRecords *MetaIndexParser, + DiffInfo const &patch, + std::vector 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 diffs=std::vector()); }; @@ -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); }; /*}}}*/ -- cgit v1.2.3