merged lp:~mvo/apt/add-missing-dsc-hashes
[ntk/apt.git] / methods / copy.cc
index 94467e0..e81d002 100644 (file)
@@ -12,6 +12,7 @@
 #include <config.h>
 
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
@@ -37,7 +38,7 @@ class CopyMethod : public pkgAcqMethod
 bool CopyMethod::Fetch(FetchItem *Itm)
 {
    URI Get = Itm->Uri;
-   string File = Get.Path;
+   std::string File = Get.Path;
 
    // Stat the file and send a start message
    struct stat Buf;
@@ -84,7 +85,7 @@ bool CopyMethod::Fetch(FetchItem *Itm)
    
    Hashes Hash;
    FileFd Fd(Res.Filename, FileFd::ReadOnly);
-   Hash.AddFD(Fd.Fd(), Fd.Size());
+   Hash.AddFD(Fd);
    Res.TakeHashes(Hash);
 
    URIDone(Res);