]> git.saurik.com Git - apt.git/blobdiff - methods/file.cc
merged from donkult
[apt.git] / methods / file.cc
index 3500de9f5f100cab17ac53e8e97af267e7773845..9cdd5bc2d3b3a3ea9ff14f2732ef832780e146cd 100644 (file)
@@ -15,6 +15,8 @@
 // Include Files                                                       /*{{{*/
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/fileutl.h>
 
 #include <sys/stat.h>
 #include <unistd.h>
@@ -75,7 +77,11 @@ bool FileMethod::Fetch(FetchItem *Itm)
    
    if (Res.Filename.empty() == true)
       return _error->Error(_("File not found"));
-   
+
+   Hashes Hash;
+   FileFd Fd(Res.Filename, FileFd::ReadOnly);
+   Hash.AddFD(Fd.Fd(), Fd.Size());
+   Res.TakeHashes(Hash);
    URIDone(Res);
    return true;
 }