summaryrefslogtreecommitdiff
path: root/apt-pkg/sourcelist.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-01-20 08:10:50 +0100
committerMichael Vogt <mvo@debian.org>2014-01-20 08:10:50 +0100
commit75c10df1533ede97e05fef3d1e2fc6a22fc4db00 (patch)
tree2df3cde9610b399fa236e021d92d6e97ae798fec /apt-pkg/sourcelist.cc
parent7dd62ea93413a73b4ec394b16ff4e0367d226395 (diff)
add support for multiple URIs in deb822 style sources.list
Diffstat (limited to 'apt-pkg/sourcelist.cc')
-rw-r--r--apt-pkg/sourcelist.cc29
1 files changed, 18 insertions, 11 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index 5d41fb00e..339005149 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -78,13 +78,6 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,
{
map<string, string> Options;
- string URI = Tags.FindS("URI");
- if (!FixupURI(URI))
- {
- _error->Error(_("Malformed stanza %u in source list %s (URI parse)"),i,Fd.Name().c_str());
- return false;
- }
-
string Enabled = Tags.FindS("Enabled");
if (Enabled.size() > 0 && StringToBool(Enabled) == false)
return true;
@@ -104,20 +97,34 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,
string Suite = Tags.FindS("Suites");
Suite = SubstVar(Suite,"$(ARCH)",_config->Find("APT::Architecture"));
string const Section = Tags.FindS("Sections");
+ string URIS = Tags.FindS("URIs");
+ std::vector<std::string> list_uris = StringSplit(URIS, " ");
std::vector<std::string> list_dist = StringSplit(Suite, " ");
std::vector<std::string> list_section = StringSplit(Section, " ");
- for (std::vector<std::string>::const_iterator I = list_dist.begin();
- I != list_dist.end(); I++)
+
+ for (std::vector<std::string>::const_iterator U = list_uris.begin();
+ U != list_uris.end(); U++)
{
- for (std::vector<std::string>::const_iterator J = list_section.begin();
- J != list_section.end(); J++)
+ std::string URI = (*U);
+ if (!FixupURI(URI))
+ {
+ _error->Error(_("Malformed stanza %u in source list %s (URI parse)"),i,Fd.Name().c_str());
+ return false;
+ }
+
+ for (std::vector<std::string>::const_iterator I = list_dist.begin();
+ I != list_dist.end(); I++)
+ {
+ for (std::vector<std::string>::const_iterator J = list_section.begin();
+ J != list_section.end(); J++)
{
if (CreateItem(List, URI, (*I), (*J), Options) == false)
{
return false;
}
}
+ }
}
return true;
}