Просмотр исходного кода

re-add compat pkgSrcRecords::File::MD5Hash

Michael Vogt лет назад: 13
Родитель
Сommit
a1b5561a03
2 измененных файлов с 4 добавлено и 0 удалено
  1. 3 0
      apt-pkg/deb/debsrcrecords.cc
  2. 1 0
      apt-pkg/srcrecords.h

+ 3 - 0
apt-pkg/deb/debsrcrecords.cc

@@ -157,6 +157,9 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &List)
                                  SourceHashFields[i].first);
                                  SourceHashFields[i].first);
          // assign full hash string
          // assign full hash string
          F.Hash = HashString(SourceHashFields[i].second, RawHash).toStr();
          F.Hash = HashString(SourceHashFields[i].second, RawHash).toStr();
+         // API compat hack 
+         if(SourceHashFields[i].second == "MD5Sum")
+            F.MD5Hash = RawHash;
          
          
          // Parse the size and append the directory
          // Parse the size and append the directory
          F.Size = atoi(Size.c_str());
          F.Size = atoi(Size.c_str());

+ 1 - 0
apt-pkg/srcrecords.h

@@ -31,6 +31,7 @@ class pkgSrcRecords
    // Describes a single file
    // Describes a single file
    struct File
    struct File
    {
    {
+      std::string MD5Hash;
       std::string Hash;
       std::string Hash;
       unsigned long Size;
       unsigned long Size;
       std::string Path;
       std::string Path;