summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-05-14 18:04:48 +0200
committerMichael Vogt <mvo@debian.org>2014-05-14 18:04:48 +0200
commite110d7bf5675f484c06b82f621ac98bedc464865 (patch)
tree70ce5da7ad75ccbaf4b30cf4809209993ba98b23 /cmdline/apt-get.cc
parent0b58b3f8917a49d83154fd3173bca36c1d617ef0 (diff)
parent4f6d26b4d41474aa390329b7e9cb167eb70b2821 (diff)
Merge remote-tracking branch 'donkult/debian/experimental' into debian/experimental
Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 1148dbbf3..3388351d9 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -828,20 +828,25 @@ 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->Hash.empty() && FileExists(flNotDir(I->Path)))
- {
- HashString hash_string = HashString(I->Hash);
- if(hash_string.VerifyFile(flNotDir(I->Path)))
+ std::string localFile = flNotDir(I->Path);
+ if (FileExists(localFile) == true)
+ if(I->Hashes.VerifyFile(localFile) == true)
{
ioprintf(c1out,_("Skipping already downloaded file '%s'\n"),
- flNotDir(I->Path).c_str());
+ localFile.c_str());
continue;
}
+
+ // see if we have a hash (Acquire::ForceHash is the only way to have none)
+ if (I->Hashes.usable() == false && _config->FindB("APT::Get::AllowUnauthenticated",false) == false)
+ {
+ ioprintf(c1out, "Skipping download of file '%s' as requested hashsum is not available for authentication\n",
+ localFile.c_str());
+ continue;
}
new pkgAcqFile(&Fetcher,Last->Index().ArchiveURI(I->Path),
- I->Hash,I->Size,
- Last->Index().SourceInfo(*Last,*I),Src);
+ I->Hashes, I->Size, Last->Index().SourceInfo(*Last,*I), Src);
}
}