diff options
author | Michael Vogt <egon@debian-devbox> | 2013-03-01 12:35:52 +0100 |
---|---|---|
committer | Michael Vogt <egon@debian-devbox> | 2013-03-01 12:35:52 +0100 |
commit | 52d5690b47bd4efe425fa23d9f6559bb44324cd1 (patch) | |
tree | 37bb957658c736f32c0af21ecdf6aa367be730ad /cmdline/apt-get.cc | |
parent | 7e789027197cdfb4b6aefb0b41a34a45fa10431d (diff) | |
parent | 36e42433c3a1f04b7c3417b313418fd1c6b035fe (diff) |
merged lp:~mvo/apt/source-hashes
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index e3c74a099..b2e1cfeba 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2555,15 +2555,12 @@ bool DoSource(CommandLine &CmdL) if(queued.find(Last->Index().ArchiveURI(I->Path)) != queued.end()) continue; 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()); @@ -2572,7 +2569,7 @@ 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); } } |