X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/5465192b9aeb1ccea778950ccf2d1b7b32f2cd91..bf33c3bd991be704494a060730f8370fd9cad52c:/apt-pkg/deb/debmetaindex.cc diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 123c91648..69e41a6f4 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -20,12 +20,9 @@ #include #include #include -#include #include -#include #include -#include #include #include @@ -157,7 +154,7 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI, Options.insert(std::make_pair("ARCHITECTURE", *A)); Options.insert(std::make_pair("BASE_URI", baseURI)); Options.insert(std::make_pair("REPO_URI", URI)); - Options.insert(std::make_pair("TARGET_OF", "deb-src")); + Options.insert(std::make_pair("TARGET_OF", Type)); Options.insert(std::make_pair("CREATED_BY", *T)); std::string MetaKey = tplMetaKey; @@ -718,10 +715,25 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ List.push_back(Deb); } + std::vector const alltargets = _config->FindVector(std::string("Acquire::IndexTargets::") + Name, "", true); + std::vector mytargets = parsePlusMinusOptions("target", Options, alltargets); + if (mytargets.empty() == false) + for (auto const &target : alltargets) + { + std::map::const_iterator const opt = Options.find(target); + if (opt == Options.end()) + continue; + auto const tarItr = std::find(mytargets.begin(), mytargets.end(), target); + bool const optValue = StringToBool(opt->second); + if (optValue == true && tarItr == mytargets.end()) + mytargets.push_back(target); + else if (optValue == false && tarItr != mytargets.end()) + mytargets.erase(std::remove(mytargets.begin(), mytargets.end(), target), mytargets.end()); + } Deb->AddComponent( IsSrc, Section, - parsePlusMinusOptions("target", Options, _config->FindVector(std::string("Acquire::IndexTargets::") + Name, "", true)), + mytargets, parsePlusMinusOptions("arch", Options, APT::Configuration::getArchitectures()), parsePlusMinusOptions("lang", Options, APT::Configuration::getLanguages(true)) );