diff options
author | Matt Zimmerman <matt.zimmerman@canonical.com> | 2004-12-14 13:25:29 +0000 |
---|---|---|
committer | Matt Zimmerman <matt.zimmerman@canonical.com> | 2004-12-14 13:25:29 +0000 |
commit | 4a1778448653283970ea094822738ddbed8f7825 (patch) | |
tree | 8075a7a6fed5079af1054df349e7c387017133f7 /apt-pkg | |
parent | 3826564e07eaffb05eca5af34a0e76f6f161b89c (diff) |
Merge from mvo
Patches applied:
* michael.vogt@canonical.com--2004--laptop/apt--authentication-mvo--0--patch-2
* ignore errors when a Packages.bz2/Sources.bz2 can't be found and try with Packages.gz/Sources.gz again
* michael.vogt@canonical.com--2004--laptop/apt--mvo--0--base-0
tag of apt@packages.debian.org/apt--main--0--patch-34
* michael.vogt@canonical.com--2004--laptop/apt--mvo--0--patch-1
* merged matt's tree (with all those apt-authentication changes)
* michael.vogt@canonical.com--2004--laptop/apt--mvo--0--patch-2
don't display a error if a bzip2 package can not be downloaded, just ignore (Ign) it
* michael.vogt@canonical.com--2004--laptop/apt--mvo--0--patch-3
* "chmod 755 cmdline/apt-key", changed version to 0.6.27ubuntu1
* michael.vogt@canonical.com--2004--laptop/apt--mvo--0--patch-4
* fix for a stupid merge error (from 0.5->0.6)
* michael.vogt@canonical.com--2004--laptop/apt--mvo--0--patch-5
* unstable should really be hoary
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-item.cc | 26 | ||||
-rw-r--r-- | apt-pkg/acquire-item.h | 2 |
2 files changed, 20 insertions, 8 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index ada640936..f40c6a50d 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -137,7 +137,7 @@ void pkgAcquire::Item::Rename(string From,string To) instantiated to fetch the revision file */ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, string URI,string URIDesc,string ShortDesc, - string ExpectedMD5) : + string ExpectedMD5, string comprExt) : Item(Owner), RealURI(URI), ExpectedMD5(ExpectedMD5) { Decompression = false; @@ -146,11 +146,17 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, DestFile = _config->FindDir("Dir::State::lists") + "partial/"; DestFile += URItoFileName(URI); - // Create the item - if(FileExists("/usr/bin/bzip2")) - Desc.URI = URI + ".bz2"; - else - Desc.URI = URI + ".gz"; + if(comprExt.empty()) + { + // autoselect + if(FileExists("/usr/bin/bzip2")) + Desc.URI = URI + ".bz2"; + else + Desc.URI = URI + ".gz"; + } else { + Desc.URI = URI + comprExt; + } + Desc.Description = URIDesc; Desc.Owner = this; Desc.ShortDesc = ShortDesc; @@ -179,7 +185,13 @@ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) // no .bz2 found, retry with .gz if(Desc.URI.substr(Desc.URI.size()-3,Desc.URI.size()-1) == "bz2") { Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz"; - QueueURI(Desc); + + // retry with a gzip one + new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc, + ExpectedMD5, string(".gz")); + Status = StatDone; + Complete = false; + Dequeue(); return; } diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 2b122cffb..ea71153d5 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -103,7 +103,7 @@ class pkgAcqIndex : public pkgAcquire::Item virtual string DescURI() {return RealURI + ".gz";}; pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc, - string ShortDesct, string ExpectedMD5); + string ShortDesct, string ExpectedMD5, string compressExt=""); }; struct IndexTarget |