X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/80624be7c54aec6ed98ee254366155024fca1a71..ca15786a9ae637048e329c159831dd486c54dea7:/apt-pkg/acquire-item.h diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 6e204813a..d0a61f5ec 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -245,12 +245,12 @@ class pkgAcquire::Item : public WeakPointable * * \return a URI that should be used to describe what is being fetched. */ - virtual std::string DescURI() const = 0; + virtual std::string DescURI() = 0; /** \brief Short item description. * * \return a brief description of the object being fetched. */ - virtual std::string ShortDesc() const {return DescURI();} + virtual std::string ShortDesc() {return DescURI();} /** \brief Invoked by the worker when the download is completely done. */ virtual void Finished() {}; @@ -289,7 +289,8 @@ class pkgAcquire::Item : public WeakPointable * \param Owner The new owner of this item. * \param ExpectedHashes of the file represented by this item */ - Item(pkgAcquire *Owner, HashStringList const &ExpectedHashes); + Item(pkgAcquire *Owner, + HashStringList const &ExpectedHashes=HashStringList()); /** \brief Remove this item from its owner's queue by invoking * pkgAcquire::Remove. @@ -346,7 +347,7 @@ class pkgAcqSubIndex : public pkgAcquire::Item virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() const {return Desc.URI;}; + virtual std::string DescURI() {return Desc.URI;}; virtual std::string Custom600Headers() const; virtual bool ParseIndex(std::string const &IndexFile); @@ -422,7 +423,7 @@ class pkgAcqDiffIndex : public pkgAcqBaseIndex virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() const {return RealURI + "Index";}; + virtual std::string DescURI() {return RealURI + "Index";}; virtual std::string Custom600Headers() const; /** \brief Parse the Index file for a set of Packages diffs. @@ -515,7 +516,7 @@ class pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() const {return RealURI + "Index";}; + virtual std::string DescURI() {return RealURI + "Index";}; /** \brief Create an index merge-diff item. * @@ -640,7 +641,7 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() const {return RealURI + "Index";}; + virtual std::string DescURI() {return RealURI + "Index";}; /** \brief Create an index diff item. * @@ -693,15 +694,8 @@ class pkgAcqIndex : public pkgAcqBaseIndex */ bool Erase; - /** \brief Verify for correctness by checking if a "Package" - * tag is found in the index. This can be set to - * false for optional index targets - * - */ - // FIXME: instead of a bool it should use a verify string that will - // then be used in the pkgAcqIndex::Done method to ensure that - // the downloaded file contains the expected tag - bool Verify; + // 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). @@ -713,6 +707,18 @@ class pkgAcqIndex : public pkgAcqBaseIndex */ std::string CompressionExtension; + + /** \brief Do the changes needed to fetch via AptByHash (if needed) */ + void InitByHashIfNeeded(const std::string MetaKey); + + /** \brief Get the full pathname of the final file for the given URI + */ + std::string GetFinalFilename(std::string const &URI, + std::string const &compExt); + + /** \brief Schedule file for verification after a IMS hit */ + void ReverifyAfterIMS(std::string const &FileName); + public: // Specialized action members @@ -720,7 +726,7 @@ class pkgAcqIndex : public pkgAcqBaseIndex virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, pkgAcquire::MethodConfig *Cnf); virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Desc.URI;}; + virtual std::string DescURI() {return Desc.URI;}; /** \brief Create a pkgAcqIndex. * @@ -884,7 +890,7 @@ class pkgAcqMetaSig : public pkgAcquire::Item virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, pkgAcquire::MethodConfig *Cnf); virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return RealURI; }; + virtual std::string DescURI() {return RealURI; }; /** \brief Create a new pkgAcqMetaSig. */ pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc, @@ -977,7 +983,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, pkgAcquire::MethodConfig *Cnf); virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return RealURI; }; + virtual std::string DescURI() {return RealURI; }; /** \brief Create a new pkgAcqMetaIndex. */ pkgAcqMetaIndex(pkgAcquire *Owner, @@ -1071,8 +1077,8 @@ class pkgAcqArchive : public pkgAcquire::Item virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() const {return Desc.URI;}; - virtual std::string ShortDesc() const {return Desc.ShortDesc;}; + virtual std::string DescURI() {return Desc.URI;}; + virtual std::string ShortDesc() {return Desc.ShortDesc;}; virtual void Finished(); virtual bool IsTrusted() const; @@ -1121,7 +1127,7 @@ class pkgAcqFile : public pkgAcquire::Item virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); virtual void Done(std::string Message,unsigned long long Size, HashStringList const &CalcHashes, pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() const {return Desc.URI;}; + virtual std::string DescURI() {return Desc.URI;}; virtual std::string Custom600Headers() const; /** \brief Create a new pkgAcqFile object.