summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-08-19 00:00:23 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2014-05-09 13:06:27 +0200
commitb3501edb7091ca3aa6c2d6d96dc667b8161dd2b9 (patch)
tree078d7f11b418e900e21f009275e74b51918c5961 /cmdline
parent1262d35895c930f3fa49d7b4182cdd7a4a841f74 (diff)
use HashStringList in the acquire system
It is not very extensible to have the supported Hashes hardcoded everywhere and especially if it is part of virtual method names. It is also possible that a method does not support the 'best' hash (yet), so we might end up not being able to verify a file even though we have a common subset of supported hashes. And those are just two of the cases in which it is handy to have a more dynamic selection. The downside is that this is a MAJOR API break, but the HashStringList has a string constructor for compatibility, so with a bit of luck the few frontends playing with the acquire system directly are okay.
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index fc6223989..3388351d9 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -838,8 +838,7 @@ static bool DoSource(CommandLine &CmdL)
}
// see if we have a hash (Acquire::ForceHash is the only way to have none)
- HashString const * const hs = I->Hashes.find(NULL);
- if (hs == NULL && _config->FindB("APT::Get::AllowUnauthenticated",false) == false)
+ 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());
@@ -847,8 +846,7 @@ static bool DoSource(CommandLine &CmdL)
}
new pkgAcqFile(&Fetcher,Last->Index().ArchiveURI(I->Path),
- hs != NULL ? hs->toStr() : "", I->Size,
- Last->Index().SourceInfo(*Last,*I),Src);
+ I->Hashes, I->Size, Last->Index().SourceInfo(*Last,*I), Src);
}
}