summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.h
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2006-04-02 13:12:05 +0200
committerMichael Vogt <egon@bottom>2006-04-02 13:12:05 +0200
commit376091144df4991f161f068f2c297b80e94d36db (patch)
treee0515b0d1b2b520560ec854467ead44d6d53db2a /apt-pkg/acquire-item.h
parenta07f63d9f23dbd619663c33b4eee10e86ae26672 (diff)
parent8f30ca302e4235985982a0f2b1e83dfe977ed12c (diff)
* merged the pdiff stuff
Diffstat (limited to 'apt-pkg/acquire-item.h')
-rw-r--r--apt-pkg/acquire-item.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index da1bea801..3649d7a03 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -82,6 +82,70 @@ class pkgAcquire::Item
virtual ~Item();
};
+// 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
+ 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 Description;
+ vector<DiffInfo> 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";};
+
+ // 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<DiffInfo> diffs=vector<DiffInfo>());
+};
+
// Item class for index files
class pkgAcqIndex : public pkgAcquire::Item
{