summaryrefslogtreecommitdiff
path: root/cmdline/apt-helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline/apt-helper.cc')
-rw-r--r--cmdline/apt-helper.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index 37279ec28..2c1107d90 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -40,11 +40,14 @@ static bool DoDownloadFile(CommandLine &CmdL)
Fetcher.Setup(&Stat);
std::string download_uri = CmdL.FileList[1];
std::string targetfile = CmdL.FileList[2];
- new pkgAcqFile(&Fetcher, download_uri, "", 0, "desc", "short-desc",
+ std::string hash;
+ if (CmdL.FileSize() > 3)
+ hash = CmdL.FileList[3];
+ new pkgAcqFile(&Fetcher, download_uri, hash, 0, "desc", "short-desc",
"dest-dir-ignored", targetfile);
Fetcher.Run();
bool Failed = false;
- if (AcquireRun(Fetcher, 0, &Failed, NULL) == false || Failed == false ||
+ if (AcquireRun(Fetcher, 0, &Failed, NULL) == false || Failed == true ||
FileExists(targetfile) == false)
return _error->Error(_("Download Failed"));
return true;