From ac5b205a831168ee76e8760e19eb7d43aa361851 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 15 Apr 2005 11:27:58 +0000 Subject: * first rewrite of the apt pdiff support patch finished --- apt-pkg/acquire-item.h | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index ea71153d5..f56fd0465 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -82,6 +82,41 @@ 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; + vector needed_files; + + 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 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 diffs=vector()); +}; + // Item class for index files class pkgAcqIndex : public pkgAcquire::Item { @@ -92,7 +127,7 @@ class pkgAcqIndex : public pkgAcquire::Item pkgAcquire::ItemDesc Desc; string RealURI; string ExpectedMD5; - + public: // Specialized action members -- cgit v1.2.3 From 6cb30d01f8e247e85966ba8ad657453d73598527 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 7 May 2005 15:39:12 +0000 Subject: * use "red" now, print meaningfull pdiff names, use IMS for the IndexDiff --- apt-pkg/acquire-item.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index f56fd0465..6c78f33ef 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -94,8 +94,14 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item string ServerSha1; string CurrentPackagesFile; string Description; - vector needed_files; + struct DiffInfo { + string file; + string sha1; + unsigned long size; + }; + vector needed_files; + public: // Specialized action members @@ -103,7 +109,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item 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); @@ -114,7 +120,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item pkgAcqIndexDiffs(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesct, string ExpectedMD5, - vector diffs=vector()); + vector diffs=vector()); }; // Item class for index files -- cgit v1.2.3 From 4a0a786f45a78eb8631c0e2d39d804ab9fdea214 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 19 Aug 2005 15:07:53 +0000 Subject: * use the new cool rred method for the patchting --- apt-pkg/acquire-item.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 8d58a39ba..99629216a 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -90,6 +90,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item pkgAcquire::ItemDesc Desc; string RealURI; string ExpectedMD5; + // this is the SHA-1 sum we expect after the patching string ServerSha1; string CurrentPackagesFile; @@ -100,7 +101,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item unsigned long size; }; vector available_patches; - + enum {StateFetchIndex,StateFetchDiff,StateUnzipDiff,StateApplyDiff} State; public: -- cgit v1.2.3 From 2237bd010018aedc2c301cd9357eb5ea6affb436 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 29 Aug 2005 23:23:31 +0000 Subject: * split the diff acquire code in a bit that gets the index file and one that gets the patches. that make the code cleaner and the list-cleaner happy --- apt-pkg/acquire-item.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 99629216a..f9c1b5b2d 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -83,6 +83,27 @@ class pkgAcquire::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: @@ -113,8 +134,6 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item virtual string Custom600Headers(); // various helpers - bool ParseIndexDiff(string IndexDiffFile); - void QueueDiffIndex(string URI); bool QueueNextDiff(); bool ApplyDiff(string PatchFile); void Finish(bool allDone=false); -- cgit v1.2.3 From 002d99439f800af38ee08fb89ef9651db727f36b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 29 Aug 2005 23:48:15 +0000 Subject: * fixed apt-pkg/acquire-item.h (looks like the last commit didn't include it?) --- apt-pkg/acquire-item.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index f9c1b5b2d..b55ac526b 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -83,11 +83,22 @@ class pkgAcquire::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 @@ -102,7 +113,7 @@ class pkgAcqDiffIndex : public pkgAcquire::Item pkgAcqDiffIndex(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesct, string ExpectedMD5); -} +}; class pkgAcqIndexDiffs : public pkgAcquire::Item { @@ -113,14 +124,7 @@ 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 available_patches; enum {StateFetchIndex,StateFetchDiff,StateUnzipDiff,StateApplyDiff} State; @@ -131,7 +135,6 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item 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(); -- cgit v1.2.3