diff options
author | André Klitzing <aklitzing@gmail.com> | 2017-07-08 16:42:02 (GMT) |
---|---|---|
committer | André Klitzing <aklitzing@gmail.com> | 2017-07-14 06:57:17 (GMT) |
commit | c4647d84321f4a7b52301237394087065f5df33c (patch) | |
tree | 7fb689a0052667a611020e9d9169afa2160b1ba5 /Source/CPack/cmCPackDebGenerator.cxx | |
parent | 501a4feea8d0d007ce292defec1c97d6eb702409 (diff) | |
download | CMake-c4647d84321f4a7b52301237394087065f5df33c.zip CMake-c4647d84321f4a7b52301237394087065f5df33c.tar.gz CMake-c4647d84321f4a7b52301237394087065f5df33c.tar.bz2 |
Change ComputeFileMD5 to ComputeFileHash
* Use a parameter to select hash algorithm
* Return a std::string as result or an empty
string if it fails
* Avoids unnecessary copy of hash value
Diffstat (limited to 'Source/CPack/cmCPackDebGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 00d017e..0705460 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -6,6 +6,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackGenerator.h" #include "cmCPackLog.h" +#include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cm_sys_stat.h" @@ -527,15 +528,13 @@ int cmCPackDebGenerator::createDeb() continue; } - char md5sum[33]; - if (!cmSystemTools::ComputeFileMD5(*fileIt, md5sum)) { + std::string output = + cmSystemTools::ComputeFileHash(*fileIt, cmCryptoHash::AlgoMD5); + if (output.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem computing the md5 of " << *fileIt << std::endl); } - md5sum[32] = 0; - - std::string output(md5sum); output += " " + *fileIt + "\n"; // debian md5sums entries are like this: // 014f3604694729f3bf19263bac599765 usr/bin/ccmake |