diff options
author | Michael Vogt <mvo@debian.org> | 2014-01-16 17:13:18 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-01-16 17:13:18 +0100 |
commit | d73743ddae1228bcd409700d8d0ffbe26e2e6cd1 (patch) | |
tree | dc402fa96de4933c73111080d09e6fa928c46178 /apt-pkg/sourcelist.cc | |
parent | a51fa92c521a6790446108a54ad1d9b6a16515ff (diff) |
support multiple "Suite:" entries
Diffstat (limited to 'apt-pkg/sourcelist.cc')
-rw-r--r-- | apt-pkg/sourcelist.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 0cea8dc7f..09d8287a0 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -85,9 +85,6 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List, return false; } - string Dist = Tags.FindS("Suite"); - Dist = SubstVar(Dist,"$(ARCH)",_config->Find("APT::Architecture")); - // Define external/internal options const char* option_deb822[] = { "Architectures", "Architectures-Add", "Architectures-Delete", "Trusted", @@ -99,13 +96,25 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List, if (Tags.Exists(option_deb822[j])) Options[option_internal[j]] = Tags.FindS(option_deb822[j]); - // now create one item per section + // now create one item per suite/section + string Suite = Tags.FindS("Suite"); + Suite = SubstVar(Suite,"$(ARCH)",_config->Find("APT::Architecture")); string const Section = Tags.FindS("Section"); - std::vector<std::string> list = StringSplit(Section, " "); - for (std::vector<std::string>::const_iterator I = list.begin(); - I != list.end(); I++) - return CreateItem(List, URI, Dist, (*I), Options); - + + 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 J = list_section.begin(); + J != list_section.end(); J++) + { + if (CreateItem(List, URI, (*I), (*J), Options) == false) + { + return false; + } + } + } return true; } |