diff options
author | Michael Vogt <mvo@debian.org> | 2005-10-17 14:56:57 +0000 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2005-10-17 14:56:57 +0000 |
commit | 5e9d46df79517125d0fd72e7671f5e0995746677 (patch) | |
tree | 8736bb81b19535094fd77fb90b8218af5e55f004 /apt-pkg/acquire-item.h | |
parent | c511502fcec38680fff2f27aec75908e348e5905 (diff) | |
parent | cec6091772ae3463cb04c417e3f598f9b6814516 (diff) |
* merged pdiff support
Patches applied:
* michael.vogt@canonical.com--2004/apt--bwlimit--0--base-0
tag of apt@packages.debian.org/apt--main--0--patch-47
* michael.vogt@canonical.com--2004/apt--bwlimit--0--patch-1
* fist attempt for bwlimit
* michael.vogt@canonical.com--2004/apt--bwlimit--0--patch-2
* add a nanosleep, making it less cpu intensive
* michael.vogt@canonical.com--2004/apt--bwlimit--0--patch-3
* use SingleInstance when DlLimit is activated
* michael.vogt@canonical.com--2004/apt--bwlimit--0--patch-4
* cleanups, no code changes
* michael.vogt@ubuntu.com--2005/apt--bwlimit--0--base-0
tag of apt@packages.debian.org/apt--main--0--patch-76
* michael.vogt@ubuntu.com--2005/apt--bwlimit--0--patch-1
* merged the apt--main with the 2004 bwlimit tree
* michael.vogt@ubuntu.com--2005/apt--local-install--0--base-0
tag of michael.vogt@ubuntu.com--2005/apt--bwlimit--0--patch-1
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--base-0
tag of michael.vogt@ubuntu.com--2005/apt--local-install--0--base-0
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-1
* first rewrite of the apt pdiff support patch finished
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-2
* use "red" now, print meaningfull pdiff names, use IMS for the IndexDiff
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-3
* merge with matt, search for the right patch next instead of applying them in order
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-4
* fix a bug QueueNextDiff
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-5
* another bug in QueueNextDiff fixed
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-6
* merged with apt--main and apt--fixes
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-7
* added methods/rred.cc (thanks to robertle)
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-8
* use the new cool rred method for the patchting
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-9
* merged with mainline
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-10
* rred.cc: use the d'tor of FileFd to close the file-fd; acquuire-item.cc: make the QueueNextDiff() code more robust
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-11
* bugfix/updates in the rred.cc code (big thanks for helping Robert!)
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-12
* method/rred.cc cleanup (thanks to robertle)
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-13
* debug support (Debug::pkgAcquire::RRed) for rred method added
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-14
* 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
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-15
* fixed apt-pkg/acquire-item.h (looks like the last commit didn't include it?)
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-16
* fix a missing StatDone if nothing needs to be fetched
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-17
* be less verbose and call the Url-Remap: APT::URL-Remap
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-18
* dont bump the soname, it doesn't break the abi!
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-19
* merged with michael.vogt@ubuntu.com--2005/apt--mvo--0 to be in sync with debian
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-20
* don't forget the final md5sum checking!
* michael.vogt@ubuntu.com--2005/apt--pdiff--0--patch-21
* removed the URL-Reamp hack (we have pdiff support in the main archive now), removed bw-limit support (NO idea how that got into this archive in the first place)
Diffstat (limited to 'apt-pkg/acquire-item.h')
-rw-r--r-- | apt-pkg/acquire-item.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index ae2fba4d5..34fcc2a76 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 { |