summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 566103f8c..f682074a7 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -828,13 +828,10 @@ static bool DoSource(CommandLine &CmdL)
queued.insert(Last->Index().ArchiveURI(I->Path));
// check if we have a file with that md5 sum already localy
- if(!I->MD5Hash.empty() && FileExists(flNotDir(I->Path)))
+ if(!I->Hash.empty() && FileExists(flNotDir(I->Path)))
{
- FileFd Fd(flNotDir(I->Path), FileFd::ReadOnly);
- MD5Summation sum;
- sum.AddFD(Fd.Fd(), Fd.Size());
- Fd.Close();
- if((string)sum.Result() == I->MD5Hash)
+ HashString hash_string = HashString(I->Hash);
+ if(hash_string.VerifyFile(flNotDir(I->Path)))
{
ioprintf(c1out,_("Skipping already downloaded file '%s'\n"),
flNotDir(I->Path).c_str());
@@ -843,7 +840,7 @@ static bool DoSource(CommandLine &CmdL)
}
new pkgAcqFile(&Fetcher,Last->Index().ArchiveURI(I->Path),
- I->MD5Hash,I->Size,
+ I->Hash,I->Size,
Last->Index().SourceInfo(*Last,*I),Src);
}
}