- 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 }
- };
- Call(baseURI, *T, URI, ShortDesc, LongDesc, IsOptional, subst);
-
- if (URI.find("$(LANGUAGE)") == std::string::npos)
+
+ std::map<std::string, std::string> Options;
+ Options.insert(std::make_pair("SITE", Site));
+ Options.insert(std::make_pair("RELEASE", Release));
+ if (tplMetaKey.find("$(COMPONENT)") != std::string::npos)
+ Options.insert(std::make_pair("COMPONENT", E->Name));
+ if (tplMetaKey.find("$(LANGUAGE)") != std::string::npos)
+ Options.insert(std::make_pair("LANGUAGE", *L));
+ if (tplMetaKey.find("$(ARCHITECTURE)") != std::string::npos)
+ 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("CREATED_BY", *T));
+
+ std::string MetaKey = tplMetaKey;
+ std::string ShortDesc = tplShortDesc;
+ std::string LongDesc = tplLongDesc;
+ for (std::map<std::string, std::string>::const_iterator O = Options.begin(); O != Options.end(); ++O)
+ {
+ MetaKey = SubstVar(MetaKey, std::string("$(") + O->first + ")", O->second);
+ ShortDesc = SubstVar(ShortDesc, std::string("$(") + O->first + ")", O->second);
+ LongDesc = SubstVar(LongDesc, std::string("$(") + O->first + ")", O->second);
+ }
+ IndexTarget Target(
+ MetaKey,
+ ShortDesc,
+ LongDesc,
+ Options.find("BASE_URI")->second + MetaKey,
+ IsOptional,
+ Options
+ );
+ IndexTargets.push_back(Target);
+
+ if (tplMetaKey.find("$(ARCHITECTURE)") == std::string::npos)