summaryrefslogtreecommitdiff
path: root/apt-pkg/sourcelist.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-01-20 08:17:43 +0100
committerMichael Vogt <mvo@debian.org>2014-01-20 08:17:43 +0100
commit7f316a3feab95370f1dd28c08c58bc3c140bf0a0 (patch)
treefd92c6a796fe39622b2d8715c46d761dc293b5ed /apt-pkg/sourcelist.cc
parent75c10df1533ede97e05fef3d1e2fc6a22fc4db00 (diff)
add support for multipl types in one line
Diffstat (limited to 'apt-pkg/sourcelist.cc')
-rw-r--r--apt-pkg/sourcelist.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index 339005149..bbc514f5b 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -387,21 +387,26 @@ int pkgSourceList::ParseFileDeb822(string File)
// read step by step
while (Sources.Step(Tags) == true)
{
- if(!Tags.Exists("Type"))
+ if(!Tags.Exists("Types"))
continue;
- string const type = Tags.FindS("Type");
- Type *Parse = Type::GetType(type.c_str());
- if (Parse == 0)
+ string const types = Tags.FindS("Types");
+ std::vector<std::string> list_types = StringSplit(types, " ");
+ for (std::vector<std::string>::const_iterator I = list_types.begin();
+ I != list_types.end(); I++)
{
- _error->Error(_("Type '%s' is not known on stanza %u in source list %s"),type.c_str(),i,Fd.Name().c_str());
- return -1;
- }
+ Type *Parse = Type::GetType((*I).c_str());
+ if (Parse == 0)
+ {
+ _error->Error(_("Type '%s' is not known on stanza %u in source list %s"), (*I).c_str(),i,Fd.Name().c_str());
+ return -1;
+ }
- if (!Parse->ParseStanza(SrcList, Tags, i, Fd))
- return -1;
+ if (!Parse->ParseStanza(SrcList, Tags, i, Fd))
+ return -1;
- i++;
+ i++;
+ }
}
// we are done, return the number of stanzas read