]> git.saurik.com Git - apt.git/blobdiff - methods/file.cc
rework hashsum verification in the acquire system
[apt.git] / methods / file.cc
index 043ab04b8286c68c03ad8290a5a1f0c918ba7eef..353e54bd5fe5ea6c6eb10f30124fc11a39d98cdf 100644 (file)
@@ -57,7 +57,11 @@ bool FileMethod::Fetch(FetchItem *Itm)
       Res.LastModified = Buf.st_mtime;
       Res.IMSHit = false;
       if (Itm->LastModified == Buf.st_mtime && Itm->LastModified != 0)
-        Res.IMSHit = true;
+      {
+        unsigned long long const filesize = Itm->ExpectedHashes.FileSize();
+        if (filesize != 0 && filesize == Res.Size)
+           Res.IMSHit = true;
+      }
    }
 
    // See if the uncompressed file exists and reuse it