summaryrefslogtreecommitdiff
path: root/methods/copy.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-08-08 19:31:03 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-08-08 19:31:03 +0200
commit73eb1788912790f19d42d8c95b98fcb5760fbbdf (patch)
tree9b254387f00a509dfe8b77e28dedd952b7d924fd /methods/copy.cc
parentb799e134fc730519cc8f0c0ea4387badffac4092 (diff)
parent95f45727964767f11534eb5347af3fc3a8a6e020 (diff)
* methods/copy.cc:
- take hashes here too * apt-pkg/acquire-worker.cc: - only pass on computed hash if we recived one from the method
Diffstat (limited to 'methods/copy.cc')
-rw-r--r--methods/copy.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/methods/copy.cc b/methods/copy.cc
index d737e3c33..8dd0bd3f5 100644
--- a/methods/copy.cc
+++ b/methods/copy.cc
@@ -12,6 +12,8 @@
#include <apt-pkg/fileutl.h>
#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 <utime.h>
@@ -78,7 +80,11 @@ bool CopyMethod::Fetch(FetchItem *Itm)
To.OpFail();
return _error->Errno("utime",_("Failed to set modification time"));
}
-
+
+ Hashes Hash;
+ FileFd Fd(Res.Filename, FileFd::ReadOnly);
+ Hash.AddFD(Fd.Fd(), Fd.Size());
+ Res.TakeHashes(Hash);
URIDone(Res);
return true;
}