diff options
author | Michael Vogt <mvo@debian.org> | 2013-12-09 08:30:01 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2013-12-09 08:30:01 +0100 |
commit | fce9f472046344d15d4f4df281a003d837cf4177 (patch) | |
tree | 42e1b4fa4101b179afaca0922168c74eafe36052 | |
parent | 1fa78a8a3730633be662df07f7aec8f4c3dcc766 (diff) |
add APT::Sources::Use-Deb822 to allow disabling the deb822 parser
-rw-r--r-- | apt-pkg/sourcelist.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 714918bc1..0bbb2bd3f 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -239,7 +239,8 @@ bool pkgSourceList::Read(string File) /* */ bool pkgSourceList::ReadAppend(string File) { - if (ParseFileDeb822(File)) + if (_config->FindB("APT::Sources::Use-Deb822", true) == true) + if (ParseFileDeb822(File)) return true; return ParseFileOldStyle(File); } @@ -305,19 +306,23 @@ bool pkgSourceList::ParseFileOldStyle(string File) /* */ bool pkgSourceList::ParseFileDeb822(string File) { - // FIXME: proper error handling so that we do not error for good old-style - // sources + + pkgTagSection Tags; + map<string, string> Options; + unsigned int i=0; + + // see if we can read the file + _error->PushToStack(); FileFd Fd(File, FileFd::ReadOnly); + pkgTagFile Sources(&Fd); if (_error->PendingError() == true) { + _error->RevertToStack(); return false; } - - pkgTagSection Tags; - map<string, string> Options; - unsigned int i=0; + _error->MergeWithStack(); - pkgTagFile Sources(&Fd); + // read step by step while (Sources.Step(Tags) == true) { if(!Tags.Exists("Type")) |