X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/2237bd010018aedc2c301cd9357eb5ea6affb436..b1a8717ae8e07101cfae03b978d57b793884a3d9:/apt-pkg/acquire-item.h?ds=sidebyside diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index f9c1b5b2d..da1bea801 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -82,67 +82,6 @@ class pkgAcquire::Item virtual ~Item(); }; -// item for index diffs -class pkgAcqDiffIndex : public pkgAcquire::Item -{ - protected: - bool Debug; - string RealURI; - - public: - // Specialized action members - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long Size,string Md5Hash, - pkgAcquire::MethodConfig *Cnf); - virtual string DescURI() {return RealURI + "Index";}; - virtual string Custom600Headers(); - - // helpers - bool ParseDiffIndex(string IndexDiffFile); - - pkgAcqDiffIndex(pkgAcquire *Owner,string URI,string URIDesc, - string ShortDesct, string ExpectedMD5); -} - -class pkgAcqIndexDiffs : public pkgAcquire::Item -{ - protected: - bool Debug; - pkgAcquire::ItemDesc Desc; - string RealURI; - string ExpectedMD5; - - // this is the SHA-1 sum we expect after the patching - string ServerSha1; - string CurrentPackagesFile; - string Description; - struct DiffInfo { - string file; - string sha1; - unsigned long size; - }; - vector available_patches; - enum {StateFetchIndex,StateFetchDiff,StateUnzipDiff,StateApplyDiff} State; - - public: - - // Specialized action members - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long Size,string Md5Hash, - pkgAcquire::MethodConfig *Cnf); - virtual string DescURI() {return RealURI + "Index";}; - virtual string Custom600Headers(); - - // various helpers - bool QueueNextDiff(); - bool ApplyDiff(string PatchFile); - void Finish(bool allDone=false); - - pkgAcqIndexDiffs(pkgAcquire *Owner,string URI,string URIDesc, - string ShortDesct, string ExpectedMD5, - vector diffs=vector()); -}; - // Item class for index files class pkgAcqIndex : public pkgAcquire::Item { @@ -153,6 +92,7 @@ class pkgAcqIndex : public pkgAcquire::Item pkgAcquire::ItemDesc Desc; string RealURI; string ExpectedMD5; + string CompressionExtension; public: @@ -161,7 +101,7 @@ class pkgAcqIndex : public pkgAcquire::Item virtual void Done(string Message,unsigned long Size,string Md5Hash, pkgAcquire::MethodConfig *Cnf); virtual string Custom600Headers(); - virtual string DescURI() {return RealURI + ".gz";}; + virtual string DescURI() {return RealURI + CompressionExtension;}; pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesct, string ExpectedMD5, string compressExt=""); @@ -211,8 +151,10 @@ class pkgAcqMetaIndex : public pkgAcquire::Item const vector* IndexTargets; indexRecords* MetaIndexParser; bool AuthPass; + // required to deal gracefully with problems caused by incorrect ims hits + bool IMSHit; - bool VerifyVendor(); + bool VerifyVendor(string Message); void RetrievalDone(string Message); void AuthDone(string Message); void QueueIndexes(bool verify); @@ -284,9 +226,14 @@ class pkgAcqFile : public pkgAcquire::Item pkgAcquire::MethodConfig *Cnf); virtual string MD5Sum() {return Md5Hash;}; virtual string DescURI() {return Desc.URI;}; - - pkgAcqFile(pkgAcquire *Owner,string URI,string MD5,unsigned long Size, - string Desc,string ShortDesc); + + // If DestFilename is empty, download to DestDir/ if + // DestDir is non-empty, $CWD/ otherwise. If + // DestFilename is NOT empty, DestDir is ignored and DestFilename + // is the absolute name to which the file should be downloaded. + pkgAcqFile(pkgAcquire *Owner, string URI, string MD5, unsigned long Size, + string Desc, string ShortDesc, + const string &DestDir="", const string &DestFilename=""); }; #endif