]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/sourcelist.cc
rename "Suite/Section" to plural
[apt.git] / apt-pkg / sourcelist.cc
index ddebd206d5a0592d23f017a6dcd91caf0184b470..4e580ba04f97a515396d9581505fe14366ebf7d8 100644 (file)
@@ -78,19 +78,16 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,
 {
    map<string, string> Options;
 
-   string URI = Tags.FindS("URL");
+   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 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",
+      "Architectures", "Architectures-Add", "Architectures-Remove", "Trusted",
    };
    const char* option_internal[] = { 
       "arch", "arch+", "arch-", "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
-   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);
-   
+   // now create one item per suite/section
+   string Suite = Tags.FindS("Suites");
+   Suite = SubstVar(Suite,"$(ARCH)",_config->Find("APT::Architecture"));
+   string const Section = Tags.FindS("Sections");
+
+   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;
 }