};
// item for index diffs
+
+struct DiffInfo {
+ string file;
+ string sha1;
+ unsigned long size;
+};
+
class pkgAcqDiffIndex : public pkgAcquire::Item
{
protected:
bool Debug;
+ pkgAcquire::ItemDesc Desc;
string RealURI;
+ string ExpectedMD5;
+ string CurrentPackagesFile;
+ string Description;
public:
// Specialized action members
pkgAcqDiffIndex(pkgAcquire *Owner,string URI,string URIDesc,
string ShortDesct, string ExpectedMD5);
-}
+};
class pkgAcqIndexDiffs : public pkgAcquire::Item
{
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<DiffInfo> available_patches;
enum {StateFetchIndex,StateFetchDiff,StateUnzipDiff,StateApplyDiff} State;
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();
pkgAcquire::ItemDesc Desc;
string RealURI;
string ExpectedMD5;
+ string CompressionExtension;
public:
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="");
const vector<struct IndexTarget*>* 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);
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/<basename> if
+ // DestDir is non-empty, $CWD/<basename> 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