summaryrefslogtreecommitdiff
path: root/methods/cdrom.cc
diff options
context:
space:
mode:
Diffstat (limited to 'methods/cdrom.cc')
-rw-r--r--methods/cdrom.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index 7cc036814..41eb8a0ee 100644
--- a/methods/cdrom.cc
+++ b/methods/cdrom.cc
@@ -13,6 +13,7 @@
#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -180,6 +181,12 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
CurrentID = NewID;
Res.LastModified = Buf.st_mtime;
Res.Size = Buf.st_size;
+
+ Hashes Hash;
+ FileFd Fd(Res.Filename, FileFd::ReadOnly);
+ Hash.AddFD(Fd.Fd(), Fd.Size());
+ Res.TakeHashes(Hash);
+
URIDone(Res);
return true;
}