summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire-item.h')
-rw-r--r--apt-pkg/acquire-item.h43
1 files changed, 42 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index ea71153d5..8d58a39ba 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -82,6 +82,47 @@ class pkgAcquire::Item
virtual ~Item();
};
+// item for index diffs
+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<DiffInfo> available_patches;
+
+
+ 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 ParseIndexDiff(string IndexDiffFile);
+ void QueueDiffIndex(string URI);
+ 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
{
@@ -92,7 +133,7 @@ class pkgAcqIndex : public pkgAcquire::Item
pkgAcquire::ItemDesc Desc;
string RealURI;
string ExpectedMD5;
-
+
public:
// Specialized action members