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);
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/";
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/";
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)
{
}
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();
else
Verify = true;
- // we need this in Init()
- this->Target = Target;
- this->MetaIndexParser = MetaIndexParser;
-
Init(Target->URI, Target->Description, Target->ShortDesc);
}
/*}}}*/
};
/*}}}*/
+/** \brief Common base class for all classes that deal with fetching {{{
+ indexes
+ */
class pkgAcqBaseIndex : public pkgAcquire::Item
{
protected:
const struct IndexTarget * Target;
indexRecords *MetaIndexParser;
+ /** \brief The Hash that this file should have after download
+ */
+ HashString ExpectedHash;
+ pkgAcqBaseIndex(pkgAcquire *Owner,
+ struct IndexTarget const * const Target,
+ HashString ExpectedHash,
+ indexRecords *MetaIndexParser)
+ : Item(Owner), Target(Target), MetaIndexParser(MetaIndexParser),
+ ExpectedHash(ExpectedHash) {};
};
-
+ /*}}}*/
/** \brief An item that is responsible for fetching an index file of {{{
* package list diffs and starting the package list's download.
*
*
* \sa pkgAcqIndexDiffs, pkgAcqIndex
*/
-class pkgAcqDiffIndex : public pkgAcquire::Item
+class pkgAcqDiffIndex : public pkgAcqBaseIndex
{
protected:
/** \brief If \b true, debugging information will be written to std::clog. */
*/
std::string RealURI;
- /** \brief The Hash that the real index file should have after
- * all patches have been applied.
- */
- HashString ExpectedHash;
-
/** \brief The index file which will be patched to generate the new
* file.
*/
*/
std::string Description;
- /** \brief Pointer to the IndexTarget data
- */
- const struct IndexTarget * Target;
- indexRecords *MetaIndexParser;
-
public:
// Specialized action members
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
*
* \sa pkgAcqDiffIndex, pkgAcqIndex
*/
-class pkgAcqIndexMergeDiffs : public pkgAcquire::Item
+class pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
{
protected:
*/
std::string RealURI;
- /** \brief HashSum of the package index file that is being
- * reconstructed.
- */
- HashString ExpectedHash;
-
/** \brief description of the file being downloaded. */
std::string Description;
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.
*
*
* \sa pkgAcqDiffIndex, pkgAcqIndex
*/
-class pkgAcqIndexDiffs : public pkgAcquire::Item
+class pkgAcqIndexDiffs : public pkgAcqBaseIndex
{
private:
*/
std::string RealURI;
- /** \brief The HashSum of the package index file that is being
- * reconstructed.
- */
- HashString ExpectedHash;
-
/** A description of the file being downloaded. */
std::string Description;
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.
*
* \todo Why does pkgAcqIndex have protected members?
*/
-class pkgAcqIndex : public pkgAcquire::Item
+class pkgAcqIndex : public pkgAcqBaseIndex
{
protected:
*/
std::string RealURI;
- /** \brief The expected hashsum of the decompressed index file. */
- HashString ExpectedHash;
-
/** \brief The compression-related file extensions that are being
* added to the downloaded file one by one if first fails (e.g., "gz bz2").
*/
std::string CompressionExtension;
- /** \brief Pointer to the IndexTarget data
- */
- const struct IndexTarget * Target;
- indexRecords *MetaIndexParser;
-
public:
// Specialized action members
struct IndexTarget const * const Target,
HashString const &ExpectedHash,
indexRecords *MetaIndexParser);
- void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
+ void Init(std::string const &URI, std::string const &URIDesc,
+ std::string const &ShortDesc);
};
/*}}}*/
/** \brief An acquire item that is responsible for fetching a {{{