diff options
-rw-r--r-- | apt-pkg/acquire-item.cc | 5 | ||||
-rw-r--r-- | apt-pkg/deb/debindexfile.cc | 12 | ||||
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 21 | ||||
-rw-r--r-- | apt-pkg/init.cc | 3 | ||||
-rwxr-xr-x | aptget2 | 2 |
5 files changed, 34 insertions, 9 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 9b7eeaa35..4160767b7 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -2291,11 +2291,10 @@ void pkgAcqDebdelta::Finished() bool pkgAcqDebdelta::ReplaceURI() { - if (_config->Find("Aquire::Debdelta::Replace-Rule::Replace-URI", "empty") == "empty") - return _error->Error("[Debdelta] Could not find a Replace-URI"); - const Configuration::Item* item =_config->Tree("Aquire::Debdelta::Replace-Rule::URI-Space"); + const Configuration::Item* item =_config->Tree("Aquire::Debdelta::Replace-Rule"); for (item = item->Child; item != 0; item = item->Next) { size_t pos = 0; + // see if the Des.URI is available in the URI-Space if ((pos = Desc.URI.find(item->Tag, pos)) != std::string::npos) { Desc.URI.replace(pos, item->Tag.length(), item->Value); diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 4c8a6719d..4f549b7db 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -176,10 +176,14 @@ debPackagesIndex::debPackagesIndex(string const &URI, string const &Dist, string bool const &Trusted, string const &Arch) : pkgIndexFile(Trusted), URI(URI), Dist(Dist), Section(Section), Architecture(Arch) { - if (Architecture == "native") - Architecture = _config->Find("APT::Architecture"); - _config->Set("Aquire::Debdelta::Replace-Rule::URI-Space::"+URI, - _config->Find("Aquire::Debdelta::Replace-Rule::Replace-URI")); + 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)); + + //std::cerr << "==== Replacement rule: " << ReplacementItem + // << " => "<< ReplacementDefault << std::endl; } /*}}}*/ // PackagesIndex::ArchiveInfo - Short version of the archive url /*{{{*/ diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index a91cc34e9..5c4a591f1 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -425,8 +425,27 @@ class debSLTypeDebSrc : public debSLTypeDebian { Name = "deb-src"; Label = "Standard Debian source tree"; - } + } +}; + +class debSLTypeDebdelta : public debSLTypeDebian +{ +public: + + bool CreateItem(vector<metaIndex *> &List, string const &URI, + string const &Dist, string const &Section, + std::map<string, string> const &Options) const + { + return CreateItemInternal(List, URI, Dist, Section, false, Options); + } + + debSLTypeDebdelta() + { + Name = "debdelta"; + Label = "Standard Debdelta tree"; + } }; debSLTypeDeb _apt_DebType; debSLTypeDebSrc _apt_DebSrcType; +debSLTypeDebdelta _apt_DebdeltaType; diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index ef43c4415..55b6b64f4 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -41,7 +41,8 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.Set("Dir","/"); // Debdelta replacement rule - Cnf.Set("Aquire::Debdelta::Replace-Rule::Replace-URI", "http://debdeltas.debian.net/debian-deltas/"); + Cnf.Set("Aquire::Debdelta::Replace-Rule::Default", "http://debdeltas.debian.net/debian-deltas/"); + Cnf.Set("Aquire::Debdelta::Replace-Rule::http://security.debian.org/", "http://debdeltas.debian.net/debian-security-deltas/"); // State Cnf.Set("Dir::State","var/lib/apt/"); diff --git a/aptget2 b/aptget2 new file mode 100755 index 000000000..7b791880d --- /dev/null +++ b/aptget2 @@ -0,0 +1,2 @@ +#!/bin/bash +LD_LIBRARY_PATH=$PWD/build/bin $PWD/build/bin/apt-get $* |