class pkgRecords;
class pkgSourceList;
class IndexTarget;
-class pkgAcqMetaIndex;
+class pkgAcqMetaBase;
/** \brief Represents the process by which a pkgAcquire object should {{{
* retrieve a file or a collection of files.
*/
class pkgAcquire::Item : public WeakPointable
{
+ void *d;
+
protected:
/** \brief The acquire object with which this item is associated. */
*/
unsigned int QueueCounter;
- /** \brief TransactionID */
- unsigned long TransactionID;
+ /** \brief TransactionManager */
+ pkgAcqMetaBase *TransactionManager;
/** \brief The number of additional fetch items that are expected
* once this item is done.
*/
Item(pkgAcquire *Owner,
HashStringList const &ExpectedHashes=HashStringList(),
- unsigned long TransactionID=0);
+ pkgAcqMetaBase *TransactionManager=NULL);
/** \brief Remove this item from its owner's queue by invoking
* pkgAcquire::Remove.
/*}}}*/
/*}}}*/
-class pkgAcqMetaSigBase : public pkgAcquire::Item
+class pkgAcqMetaBase : public pkgAcquire::Item
{
+ void *d;
+
protected:
+ std::vector<Item*> Transaction;
+
+ public:
+ // transaction code
+ void Add(Item *I);
+ void AbortTransaction();
+ bool TransactionHasError() APT_PURE;
+ void CommitTransaction();
+
+ // helper for the signature warning
bool GenerateAuthWarning(const std::string &RealURI,
const std::string &Message);
- public:
- pkgAcqMetaSigBase(pkgAcquire *Owner,
- HashStringList const &ExpectedHashes=HashStringList(),
- unsigned long TransactionID=0);
+
+ pkgAcqMetaBase(pkgAcquire *Owner,
+ HashStringList const &ExpectedHashes=HashStringList(),
+ pkgAcqMetaBase *TransactionManager=NULL)
+ : Item(Owner, ExpectedHashes, TransactionManager) {};
};
+
/** \brief An item that is responsible for downloading the meta-index {{{
* file (i.e., Release) itself and verifying its signature.
*
* otherwise, the expected hashsums will be "" (causing the
* authentication of the index files to be bypassed).
*/
-class pkgAcqMetaIndex : public pkgAcqMetaSigBase
+class pkgAcqMetaIndex : public pkgAcqMetaBase
{
+ void *d;
+
protected:
/** \brief The URI that is actually being downloaded; never
* modified by pkgAcqMetaIndex.
/** \brief Create a new pkgAcqMetaIndex. */
pkgAcqMetaIndex(pkgAcquire *Owner,
- unsigned long TransactionID,
+ pkgAcqMetaBase *TransactionManager,
std::string URI,std::string URIDesc, std::string ShortDesc,
std::string MetaIndexSigURI, std::string MetaIndexSigURIDesc, std::string MetaIndexSigShortDesc,
const std::vector<IndexTarget*>* IndexTargets,
/** \brief An item repsonsible for downloading clearsigned metaindexes {{{*/
class pkgAcqMetaClearSig : public pkgAcqMetaIndex
{
+ void *d;
+
/** \brief The URI of the meta-index file for the detached signature */
std::string MetaIndexURI;
*/
class pkgAcqBaseIndex : public pkgAcquire::Item
{
+ void *d;
+
protected:
/** \brief Pointer to the IndexTarget data
*/
std::string MetaKey;
pkgAcqBaseIndex(pkgAcquire *Owner,
- unsigned long TransactionID,
+ pkgAcqMetaBase *TransactionManager,
struct IndexTarget const * const Target,
HashStringList const &ExpectedHashes,
indexRecords *MetaIndexParser)
- : Item(Owner, ExpectedHashes, TransactionID), Target(Target),
+ : Item(Owner, ExpectedHashes, TransactionManager), Target(Target),
MetaIndexParser(MetaIndexParser) {};
};
/*}}}*/
*/
class pkgAcqDiffIndex : public pkgAcqBaseIndex
{
+ void *d;
+
protected:
/** \brief If \b true, debugging information will be written to std::clog. */
bool Debug;
* \param ExpectedHashes The list file's hashsums which are expected.
*/
pkgAcqDiffIndex(pkgAcquire *Owner,
- unsigned long TransactionID,
+ pkgAcqMetaBase *TransactionManager,
struct IndexTarget const * const Target,
HashStringList const &ExpectedHashes,
indexRecords *MetaIndexParser);
*/
class pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
{
+ void *d;
+
protected:
/** \brief If \b true, debugging output will be written to
* check if it was the last one to complete the download step
*/
pkgAcqIndexMergeDiffs(pkgAcquire *Owner,
- unsigned long TransactionID,
+ pkgAcqMetaBase *TransactionManager,
struct IndexTarget const * const Target,
HashStringList const &ExpectedHash,
indexRecords *MetaIndexParser,
*/
class pkgAcqIndexDiffs : public pkgAcqBaseIndex
{
+ void *d;
+
private:
/** \brief Queue up the next diff download.
* that depends on it.
*/
pkgAcqIndexDiffs(pkgAcquire *Owner,
- unsigned long TransactionID,
+ pkgAcqMetaBase *TransactionManager,
struct IndexTarget const * const Target,
HashStringList const &ExpectedHash,
indexRecords *MetaIndexParser,
*/
class pkgAcqIndex : public pkgAcqBaseIndex
{
+ void *d;
+
protected:
/** \brief If \b true, the index file has been decompressed. */
*/
bool Erase;
- // FIXME:
- // Unused, used to be used to verify that "Packages: " header was there
- bool __DELME_ON_NEXT_ABI_BREAK_Verify;
-
/** \brief The object that is actually being fetched (minus any
* compression-related extensions).
*/
*/
std::string CompressionExtension;
+
/** \brief Do the changes needed to fetch via AptByHash (if needed) */
void InitByHashIfNeeded(const std::string MetaKey);
/** \brief Auto select the right compression to use */
void AutoSelectCompression();
- /** \brief Get the full pathname of the final file for the given URI
+ /** \brief Get the full pathname of the final file for the current URI
*/
- std::string GetFinalFilename(std::string const &URI,
- std::string const &compExt);
+ std::string GetFinalFilename() const;
/** \brief Schedule file for verification after a IMS hit */
- void ReverifyAfterIMS(std::string const &FileName);
+ void ReverifyAfterIMS();
public:
* fallback is ".gz" or none.
*/
pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
- std::string ShortDesc, HashStringList const &ExpectedHashes,
- std::string compressExt="");
- pkgAcqIndex(pkgAcquire *Owner, unsigned long TransactionID,
+ std::string ShortDesc, HashStringList const &ExpectedHashes);
+ pkgAcqIndex(pkgAcquire *Owner, pkgAcqMetaBase *TransactionManager,
IndexTarget const * const Target,
HashStringList const &ExpectedHash,
indexRecords *MetaIndexParser);
*/
class pkgAcqIndexTrans : public pkgAcqIndex
{
+ void *d;
+
public:
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
std::string URI,std::string URIDesc,
std::string ShortDesc);
pkgAcqIndexTrans(pkgAcquire *Owner,
- unsigned long TransactionID,
+ pkgAcqMetaBase *TransactionManager,
IndexTarget const * const Target,
HashStringList const &ExpectedHashes,
indexRecords *MetaIndexParser);
/** \brief Information about an index file. */ /*{{{*/
class IndexTarget
{
+ void *d;
+
public:
/** \brief A URI from which the index file can be downloaded. */
std::string URI;
/** \brief Information about an optional index file. */ /*{{{*/
class OptionalIndexTarget : public IndexTarget
{
+ void *d;
+
virtual bool IsOptional() const {
return true;
}
*
* \sa pkgAcqMetaIndex
*/
-class pkgAcqMetaSig : public pkgAcqMetaSigBase
+class pkgAcqMetaSig : public pkgAcqMetaBase
{
+ void *d;
+
protected:
/** \brief The last good signature file */
std::string LastGoodSig;
/** \brief Create a new pkgAcqMetaSig. */
pkgAcqMetaSig(pkgAcquire *Owner,
- unsigned long TransactionID,
+ pkgAcqMetaBase *TransactionManager,
std::string URI,std::string URIDesc, std::string ShortDesc,
std::string MetaIndexFile,
const std::vector<IndexTarget*>* IndexTargets,
*/
class pkgAcqArchive : public pkgAcquire::Item
{
+ void *d;
+
protected:
/** \brief The package version being fetched. */
pkgCache::VerIterator Version;
*/
class pkgAcqFile : public pkgAcquire::Item
{
+ void *d;
+
/** \brief How many times to retry the download, set from
* Acquire::Retries.
*/