reorder includes: add <config.h> if needed and include it at first
[ntk/apt.git] / apt-pkg / deb / debrecords.cc
index 5b8538a..db62d6c 100644 (file)
@@ -8,6 +8,8 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include <config.h>
+
 #include <apt-pkg/debrecords.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/error.h>
@@ -19,8 +21,9 @@
 // ---------------------------------------------------------------------
 /* */
 debRecordParser::debRecordParser(string FileName,pkgCache &Cache) : 
-                  File(FileName,FileFd::ReadOnly), 
-                  Tags(&File,Cache.Head().MaxVerFileSize + 200)
+                  File(FileName,FileFd::ReadOnlyGzip), 
+                  Tags(&File, std::max(Cache.Head().MaxVerFileSize, 
+                                      Cache.Head().MaxDescFileSize) + 200)
 {
 }
                                                                        /*}}}*/
@@ -76,7 +79,7 @@ string debRecordParser::SHA1Hash()
    return Section.FindS("SHA1");
 }
                                                                        /*}}}*/
-// RecordParser::SHA1Hash - Return the archive hash                    /*{{{*/
+// RecordParser::SHA256Hash - Return the archive hash                  /*{{{*/
 // ---------------------------------------------------------------------
 /* */
 string debRecordParser::SHA256Hash()
@@ -84,6 +87,14 @@ string debRecordParser::SHA256Hash()
    return Section.FindS("SHA256");
 }
                                                                        /*}}}*/
+// RecordParser::SHA512Hash - Return the archive hash                  /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+string debRecordParser::SHA512Hash()
+{
+   return Section.FindS("SHA512");
+}
+                                                                       /*}}}*/
 // RecordParser::Maintainer - Return the maintainer email              /*{{{*/
 // ---------------------------------------------------------------------
 /* */