summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-26 15:31:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-02-26 15:31:24 (GMT)
commitcc7a1b194152a171725ae9cb66c6de1e710b4ecb (patch)
tree668bb2c3444950709dd3d52d8248b6ff4840a4af /Source
parent9f7a2328acac8fa52e4b46535c69611041571de0 (diff)
parent6c9586f9c7804c4560a43aa6a03e490374174550 (diff)
downloadCMake-cc7a1b194152a171725ae9cb66c6de1e710b4ecb.zip
CMake-cc7a1b194152a171725ae9cb66c6de1e710b4ecb.tar.gz
CMake-cc7a1b194152a171725ae9cb66c6de1e710b4ecb.tar.bz2
Merge topic 'file-download-status-hash-mismatch'
6c9586f9 file(DOWNLOAD): Fill STATUS variable on hash mismatch (#15987)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFileCommand.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index b3557f9..1fa27eb 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -3300,6 +3300,15 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
<< " status: [" << (int)res << ";\""
<< ::curl_easy_strerror(res) << "\"]" << std::endl
;
+
+ if(!statusVar.empty() && res == 0)
+ {
+ std::string status = "1;HASH mismatch: "
+ "expected: " + expectedHash +
+ " actual: " + actualHash;
+ this->Makefile->AddDefinition(statusVar, status.c_str());
+ }
+
this->SetError(oss.str());
return false;
}