diff options
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index cf0a9a402..4e61f0fc2 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -72,8 +72,19 @@ string debListParser::Package() { string Result = Section.Find(pkgTagSection::Key::Package).to_string(); // 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); + // See Bug#807012 for details. + // Only do this when the package name does not contain a / - as that + // indicates that the package name was derived from a filename given + // to install or build-dep or similar (Bug#854794) + if (likely(Result.find('/') == string::npos)) + { + for (char &c: Result) + { + char l = tolower_ascii_inline(c); + if (unlikely(l != c)) + c = l; + } + } if(unlikely(Result.empty() == true)) _error->Error("Encountered a section with no Package: header"); |