From fffa3b57b4f2334dff3b9bef5401521307e1a721 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 11 Dec 2015 14:27:56 +0100 Subject: Convert package names from Packages files to lower case dpkg does that when reading package files, so we should do the same. This only deals with parsing names from binary package paragraphs, it does not look at source package names and/or the list of binaries in a dsc file. Closes: #807012 --- apt-pkg/deb/deblistparser.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 229cfc29b..bf9bc75ec 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -57,7 +57,12 @@ debListParser::debListParser(FileFd *File) : // --------------------------------------------------------------------- /* This is to return the name of the package this section describes */ string debListParser::Package() { - string const Result = Section.FindS("Package"); + string Result = Section.FindS("Package"); + + // Normalize mixed case package names to lower case, like dpkg does + // See Bug#807012 for details + std::transform(Result.begin(), Result.end(), Result.begin(), tolower_ascii); + if(unlikely(Result.empty() == true)) _error->Error("Encountered a section with no Package: header"); return Result; -- cgit v1.2.3