X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/655af1e137385aa41c5505edc350111e9f8762ca..3d8232bf97ce11818fb07813a71136484ea1a44a:/apt-pkg/sourcelist.cc?ds=sidebyside diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index ac326d157..99b646513 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -18,8 +18,18 @@ #include #include #include - +#include +#include + +#include +#include +#include +#include +#include +#include +#include #include +#include #include /*}}}*/ @@ -91,7 +101,12 @@ bool pkgSourceList::Type::ParseStanza(vector &List, }; for (unsigned int j=0; j < sizeof(option_deb822)/sizeof(char*); j++) if (Tags.Exists(option_deb822[j])) - Options[option_internal[j]] = Tags.FindS(option_deb822[j]); + { + // for deb822 the " " is the delimiter, but the backend expects "," + std::string option = Tags.FindS(option_deb822[j]); + std::replace(option.begin(), option.end(), ' ', ','); + Options[option_internal[j]] = option; + } // now create one item per suite/section string Suite = Tags.FindS("Suites"); @@ -104,7 +119,7 @@ bool pkgSourceList::Type::ParseStanza(vector &List, std::vector list_section = StringSplit(Section, " "); for (std::vector::const_iterator U = list_uris.begin(); - U != list_uris.end(); U++) + U != list_uris.end(); ++U) { std::string URI = (*U); if (!FixupURI(URI)) @@ -114,10 +129,10 @@ bool pkgSourceList::Type::ParseStanza(vector &List, } for (std::vector::const_iterator I = list_dist.begin(); - I != list_dist.end(); I++) + I != list_dist.end(); ++I) { for (std::vector::const_iterator J = list_section.begin(); - J != list_section.end(); J++) + J != list_section.end(); ++J) { if (CreateItem(List, URI, (*I), (*J), Options) == false) { @@ -221,11 +236,11 @@ bool pkgSourceList::Type::ParseLine(vector &List, // SourceList::pkgSourceList - Constructors /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgSourceList::pkgSourceList() +pkgSourceList::pkgSourceList() : d(NULL) { } -pkgSourceList::pkgSourceList(string File) +pkgSourceList::pkgSourceList(string File) : d(NULL) { Read(File); } @@ -316,7 +331,7 @@ bool pkgSourceList::ParseFileOldStyle(string File) { // Open the stream for reading ifstream F(File.c_str(),ios::in /*| ios::nocreate*/); - if (!F != 0) + if (F.fail() == true) return _error->Errno("ifstream::ifstream",_("Opening %s"),File.c_str()); // CNC:2003-12-10 - 300 is too short. @@ -393,7 +408,7 @@ int pkgSourceList::ParseFileDeb822(string File) string const types = Tags.FindS("Types"); std::vector list_types = StringSplit(types, " "); for (std::vector::const_iterator I = list_types.begin(); - I != list_types.end(); I++) + I != list_types.end(); ++I) { Type *Parse = Type::GetType((*I).c_str()); if (Parse == 0)