]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debrecords.cc
test framework: Correctly generate new paths in noopchroot
[apt.git] / apt-pkg / deb / debrecords.cc
index 326102d08e2a7b6a1ced59dbe31d7aef226286f0..beaa83bd9e279647dbdadbd4394ff2785ec80038 100644 (file)
@@ -42,10 +42,14 @@ debRecordParser::debRecordParser(string FileName,pkgCache &Cache) :
 // RecordParser::Jump - Jump to a specific record                      /*{{{*/
 bool debRecordParser::Jump(pkgCache::VerFileIterator const &Ver)
 {
+   if (Ver.end() == true)
+      return false;
    return Tags.Jump(Section,Ver->Offset);
 }
 bool debRecordParser::Jump(pkgCache::DescFileIterator const &Desc)
 {
+   if (Desc.end() == true)
+      return false;
    return Tags.Jump(Section,Desc->Offset);
 }
                                                                        /*}}}*/
@@ -61,7 +65,13 @@ string debRecordParserBase::FileName()
 // RecordParserBase::Name - Return the package name                    /*{{{*/
 string debRecordParserBase::Name()
 {
-   return 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);
+
+   return Result;
 }
                                                                        /*}}}*/
 // RecordParserBase::Homepage - Return the package homepage            /*{{{*/