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

fix skipping of already downloaded files and add some FIXMEs

Michael Vogt лет назад: 13
Родитель
Сommit
64680d3bf1
2 измененных файлов с 10 добавлено и 5 удалено
  1. 9 4
      apt-pkg/deb/debsrcrecords.cc
  2. 1 1
      cmdline/apt-get.cc

+ 9 - 4
apt-pkg/deb/debsrcrecords.cc

@@ -116,16 +116,21 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &List)
 {
    List.erase(List.begin(),List.end());
 
+   // FIXME: build string dynamically from 
+   //            Hashes::SupportedHashes
    const char *hash_field[] = { "Checksums-Sha512", 
                             "Checksums-Sha256",
                             "Checksums-Sha1",
                             "Files", // historic name
                             NULL,
    };
-   const char *hash_type[] = { "Sha512", 
-                            "Sha256",
-                            "Sha1",
-                            "md5sum",
+
+   // FIXME: use string from Hashes::SupportedHashes
+   // FIXME2: this is case senstivie
+   const char *hash_type[] = { "SHA512", 
+                            "SHA256",
+                            "SHA1",
+                            "MD5Sum",
                             NULL,
    };
    

+ 1 - 1
cmdline/apt-get.cc

@@ -2560,7 +2560,7 @@ bool DoSource(CommandLine &CmdL)
 	 if(!I->Hash.empty() && FileExists(flNotDir(I->Path)))  
 	 {
             HashString hash_string = HashString(I->Hash);
-            if(hash_string.VerifyFile(I->Path))
+            if(hash_string.VerifyFile(flNotDir(I->Path)))
 	    {
 	       ioprintf(c1out,_("Skipping already downloaded file '%s'\n"),
 			flNotDir(I->Path).c_str());