X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/2e90f6e004d937ad07fbd0cae59f321aea43a80f..b779e471ec2c549c69a0967583a1f2fee243288d:/apt-pkg/acquire-item.h?ds=sidebyside diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 3079c68ef..62162743d 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-item.h,v 1.19 1999/04/11 21:23:09 jgg Exp $ +// $Id: acquire-item.h,v 1.26 2003/02/02 03:13:13 doogie Exp $ /* ###################################################################### Acquire Item - Item to acquire @@ -21,7 +21,7 @@ #define PKGLIB_ACQUIRE_ITEM_H #include -#include +#include #include #ifdef __GNUG__ @@ -49,7 +49,7 @@ class pkgAcquire::Item string ErrorText; unsigned long FileSize; unsigned long PartialSize; - char *Mode; + const char *Mode; unsigned long ID; bool Complete; bool Local; @@ -62,14 +62,17 @@ class pkgAcquire::Item // Action members invoked by the worker virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long Size,string Md5Hash); + virtual void Done(string Message,unsigned long Size,string Md5Hash, + pkgAcquire::MethodConfig *Cnf); virtual void Start(string Message,unsigned long Size); virtual string Custom600Headers() {return string();}; virtual string DescURI() = 0; + virtual void Finished() {}; // Inquire functions virtual string MD5Sum() {return string();}; - + pkgAcquire *GetOwner() {return Owner;}; + Item(pkgAcquire *Owner); virtual ~Item(); }; @@ -79,19 +82,21 @@ class pkgAcqIndex : public pkgAcquire::Item { protected: - const pkgSourceList::Item *Location; bool Decompression; bool Erase; pkgAcquire::ItemDesc Desc; + string RealURI; public: // Specialized action members - virtual void Done(string Message,unsigned long Size,string Md5Hash); + virtual void Done(string Message,unsigned long Size,string Md5Hash, + pkgAcquire::MethodConfig *Cnf); virtual string Custom600Headers(); - virtual string DescURI() {return Location->PackagesURI();}; + virtual string DescURI() {return RealURI + ".gz";}; - pkgAcqIndex(pkgAcquire *Owner,const pkgSourceList::Item *Location); + pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc, + string ShortDesct); }; // Item class for index files @@ -99,18 +104,20 @@ class pkgAcqIndexRel : public pkgAcquire::Item { protected: - const pkgSourceList::Item *Location; pkgAcquire::ItemDesc Desc; + string RealURI; public: // Specialized action members virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long Size,string Md5Hash); + virtual void Done(string Message,unsigned long Size,string Md5Hash, + pkgAcquire::MethodConfig *Cnf); virtual string Custom600Headers(); - virtual string DescURI() {return Location->ReleaseURI();}; + virtual string DescURI() {return RealURI;}; - pkgAcqIndexRel(pkgAcquire *Owner,const pkgSourceList::Item *Location); + pkgAcqIndexRel(pkgAcquire *Owner,string URI,string URIDesc, + string ShortDesct); }; // Item class for archive files @@ -135,9 +142,11 @@ class pkgAcqArchive : public pkgAcquire::Item // Specialized action members virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long Size,string Md5Hash); + virtual void Done(string Message,unsigned long Size,string Md5Hash, + pkgAcquire::MethodConfig *Cnf); virtual string MD5Sum() {return MD5;}; virtual string DescURI() {return Desc.URI;}; + virtual void Finished(); pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources, pkgRecords *Recs,pkgCache::VerIterator const &Version, @@ -148,13 +157,16 @@ class pkgAcqArchive : public pkgAcquire::Item class pkgAcqFile : public pkgAcquire::Item { pkgAcquire::ItemDesc Desc; - string MD5; + string Md5Hash; + unsigned int Retries; public: // Specialized action members - virtual void Done(string Message,unsigned long Size,string Md5Hash); - virtual string MD5Sum() {return MD5;}; + virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Done(string Message,unsigned long Size,string Md5Hash, + pkgAcquire::MethodConfig *Cnf); + virtual string MD5Sum() {return Md5Hash;}; virtual string DescURI() {return Desc.URI;}; pkgAcqFile(pkgAcquire *Owner,string URI,string MD5,unsigned long Size,