diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-item.cc | 41 | ||||
-rw-r--r-- | apt-pkg/deb/debindexfile.cc | 6 | ||||
-rw-r--r-- | apt-pkg/init.cc | 4 |
3 files changed, 39 insertions, 12 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index c22b7fb31..503fac61e 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -2125,7 +2125,8 @@ pkgAcqDebdelta::pkgAcqDebdelta(pkgAcquire *Owner,pkgSourceList *Sources, std::cerr << "Checking index: " << Index->Describe() << "(Trusted=" << Index->IsTrusted() << ")\n"; } - if (Index->IsTrusted()) { + if (Index->IsTrusted()) + { Trusted = true; break; } @@ -2143,11 +2144,25 @@ pkgAcqDebdelta::pkgAcqDebdelta(pkgAcquire *Owner,pkgSourceList *Sources, std::cerr << " StoreFilename: " << StoreFilename << std::endl; std::cerr << " DestFile : " << DestFile << std::endl; } - DebdeltaStatus = Fetching; - if (QueueNext() == false && _error->PendingError() == false) - _error->Error(_("I wasn't able to locate a file for the %s package. " + + if (QueueNext() == false) + { + if (DebdeltaStatus == Completed && DestFile == "") + { + new pkgAcqArchive(Owner, Sources, Recs, Version, StoreFilename); + Dequeue(); + delete this; + return; + } + else if (_error->PendingError() == false) + { + _error->Error(_("I wasn't able to locate a file for the %s package. " "This might mean you need to manually fix this package."), Version.ParentPkg().Name()); + } + + } + DebdeltaStatus = Fetching; } bool pkgAcqDebdelta::QueueNext() @@ -2239,7 +2254,14 @@ bool pkgAcqDebdelta::QueueNext() else { Desc.URI = flNotFile(Index->ArchiveURI(PkgFile)) + DebdeltaName; - ReplaceURI(); + if (ReplaceURI() == false) + { + Complete = true; + Status = StatDone; + DebdeltaStatus = Completed; + StoreFilename = DestFile = ""; + return false; + } } Desc.Description = Desc.URI; // "[Debdelta] " + Index->ArchiveInfo(Version); Desc.Owner = this; @@ -2368,7 +2390,8 @@ void pkgAcqDebdelta::Finished() bool pkgAcqDebdelta::ReplaceURI() { - const Configuration::Item* item = _config->Tree("Aquire::Debdelta::Replace-Rule"); + // if we cant find a replace URI, just queue the deb instead. remove setting the rep rules from other places. + const Configuration::Item* item = _config->Tree("Aquire::Debdelta::Replace-Rule"); for (item = item->Child; item != 0; item = item->Next) { size_t pos = 0; @@ -2384,7 +2407,11 @@ bool pkgAcqDebdelta::ReplaceURI() return true; } } - return _error->Error("[Debdelta] Could not find a replacement URI."); + // no replacement rule found for this URI. Therefore, queue a reagular deb for downloading. + if (Debug) + std::cerr << "[Debdelta] No replacement rule => " << Desc.URI << std::endl; + + return false; } bool IndexTarget::IsOptional() const { diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 057a99a86..d8d972cc7 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -178,9 +178,9 @@ debPackagesIndex::debPackagesIndex(string const &URI, string const &Dist, string { if (Architecture == "native") Architecture = _config->Find("APT::Architecture"); - string ReplacementItem = "Aquire::Debdelta::Replace-Rule::" + URI;//::URI::URI(URI); - string ReplacementDefault = _config->Find("Aquire::Debdelta::Replace-Rule::Default"); - _config->Set(ReplacementItem, _config->Find(ReplacementItem, ReplacementDefault)); + //string ReplacementItem = "Aquire::Debdelta::Replace-Rule::" + URI;//::URI::URI(URI); + //string ReplacementDefault = _config->Find("Aquire::Debdelta::Replace-Rule::Default"); + //_config->Set(ReplacementItem, _config->Find(ReplacementItem, ReplacementDefault)); //std::cerr << "==== Replacement rule: " << ReplacementItem // << " => "<< ReplacementDefault << std::endl; diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 4d2eae913..ab4c4ba37 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -41,8 +41,8 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("Dir","/"); // Debdelta replacement rule - Cnf.Set("Aquire::Debdelta::Replace-Rule::Default", "http://debdeltas.debian.net/debian-deltas/");// http://www.bononia.it/debian-deltas/ - Cnf.Set("Aquire::Debdelta::Replace-Rule::http://security.debian.org/", "http://debdeltas.debian.net/debian-security-deltas/"); // http://security.ubuntu.com/ubuntu/ => http://www.bononia.it/debian-security-deltas/ + //Cnf.Set("Aquire::Debdelta::Replace-Rule::Default", "http://debdeltas.debian.net/debian-deltas/");// http://www.bononia.it/debian-deltas/ + //Cnf.Set("Aquire::Debdelta::Replace-Rule::http://security.debian.org/", "http://debdeltas.debian.net/debian-security-deltas/"); // http://security.ubuntu.com/ubuntu/ => http://www.bononia.it/debian-security-deltas/ // State Cnf.CndSet("Dir::State","var/lib/apt/"); |