+ std::vector<std::string> const targets = _config->FindVector("APT::Acquire::Targets::deb", "", true);
+ for (std::vector<std::string>::const_iterator T = targets.begin(); T != targets.end(); ++T)
+ {
+#define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb::") + *T + "::" + (X))
+ std::string const URI = APT_T_CONFIG(flatArchive ? "flatURI" : "URI");
+ std::string const ShortDesc = APT_T_CONFIG("ShortDescription");
+ std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description");
+ bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb::") + *T + "::Optional", true);
+#undef APT_T_CONFIG
+ if (URI.empty())
+ continue;
+
+ for (map<string, vector<debSectionEntry const*> >::const_iterator a = ArchEntries.begin();
+ a != ArchEntries.end(); ++a)
+ {
+ if (a->first == "source")
+ continue;
+
+ for (vector <const debSectionEntry *>::const_iterator I = a->second.begin();
+ I != a->second.end(); ++I) {
+
+ for (vector<std::string>::const_iterator l = lang.begin(); l != lang.end(); ++l)
+ {
+ if (*l == "none" && URI.find("$(LANGUAGE)") != std::string::npos)
+ continue;
+
+ struct SubstVar subst[] = {
+ { "$(SITE)", &Site },
+ { "$(RELEASE)", &Release },
+ { "$(COMPONENT)", &((*I)->Section) },
+ { "$(LANGUAGE)", &(*l) },
+ { "$(ARCHITECTURE)", &(a->first) },
+ { NULL, NULL }
+ };
+ std::string const name = SubstVar(URI, subst);
+ IndexTarget * Target;
+ if (IsOptional == true)
+ {
+ Target = new OptionalIndexTarget(
+ name,
+ SubstVar(ShortDesc, subst),
+ SubstVar(LongDesc, subst),
+ baseURI + name
+ );
+ }
+ else
+ {
+ Target = new IndexTarget(
+ name,
+ SubstVar(ShortDesc, subst),
+ SubstVar(LongDesc, subst),
+ baseURI + name
+ );
+ }
+ IndexTargets->push_back(Target);
+
+ if (URI.find("$(LANGUAGE)") == std::string::npos)
+ break;
+ }
+
+ if (URI.find("$(COMPONENT)") == std::string::npos)
+ break;
+ }
+
+ if (URI.find("$(ARCHITECTURE)") == std::string::npos)
+ break;
+ }
+ }
+
+ return IndexTargets;