summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/policy.cc4
-rw-r--r--apt-pkg/sourcelist.cc4
-rw-r--r--apt-pkg/tagfile.h4
3 files changed, 5 insertions, 7 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index d442e5c90..b36f4d4b7 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -438,11 +438,11 @@ bool ReadPinFile(pkgPolicy &Plcy,string File)
return true;
FileFd Fd(File,FileFd::ReadOnly);
- pkgTagFile TF(&Fd);
+ pkgTagFile TF(&Fd, pkgTagFile::SUPPORT_COMMENTS);
if (Fd.IsOpen() == false || Fd.Failed())
return false;
- pkgUserTagSection Tags;
+ pkgTagSection Tags;
while (TF.Step(Tags) == true)
{
// can happen when there are only comments in a record
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)
diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h
index 2f26846ef..460cf2cd6 100644
--- a/apt-pkg/tagfile.h
+++ b/apt-pkg/tagfile.h
@@ -140,9 +140,7 @@ class pkgTagSection
};
-/* For user generated file the parser should be a bit more relaxed in exchange
- for being a bit slower to allow comments and new lines all over the place */
-class pkgUserTagSection : public pkgTagSection
+class APT_DEPRECATED_MSG("Use pkgTagFile with the SUPPORT_COMMENTS flag instead") pkgUserTagSection : public pkgTagSection
{
virtual void TrimRecord(bool BeforeRecord, const char* &End) APT_OVERRIDE;
};