From f6459e646f6fa45c34d1f13f37173ea4b92ffd5f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 2 Jan 2016 13:27:02 +0100 Subject: properly parse comments in apt_preferences and deb822-style sources apt_preferences and deb822-style sources used the specialized class pkgUserTagSection to deal with comments before/after a given stanza, but it couldn't deal with comments in the stanza at all. codesearch suggests that nobody else does and a vastely superior way of working with potentially commented files is implemented now, so we can officially discourage the use of the old incomplete hack class. --- apt-pkg/sourcelist.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/sourcelist.cc') diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 6773b069f..82d2ed3c6 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -418,16 +418,16 @@ bool pkgSourceList::ParseFileOldStyle(std::string const &File) /* Returns: the number of stanzas parsed*/ bool pkgSourceList::ParseFileDeb822(string const &File) { - pkgUserTagSection Tags; unsigned int i = 1; // see if we can read the file FileFd Fd(File, FileFd::ReadOnly); - pkgTagFile Sources(&Fd); + pkgTagFile Sources(&Fd, pkgTagFile::SUPPORT_COMMENTS); if (Fd.IsOpen() == false || Fd.Failed()) return _error->Error(_("Malformed stanza %u in source list %s (type)"),i,File.c_str()); // read step by step + pkgTagSection Tags; while (Sources.Step(Tags) == true) { if(Tags.Exists("Types") == false) -- cgit v1.2.3