summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2017-09-19 22:00:42 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-20 18:01:23 (GMT)
commitb06870e5ff03da40ac265b8ba3bd84d5223bcf6b (patch)
treebc491bb18459e5e3dd675f715bceb1687d867c45 /Source/CPack/cmCPackGenerator.cxx
parent4547d9a83030f8ae7e636cef16a261c65e6feb40 (diff)
downloadCMake-b06870e5ff03da40ac265b8ba3bd84d5223bcf6b.zip
CMake-b06870e5ff03da40ac265b8ba3bd84d5223bcf6b.tar.gz
CMake-b06870e5ff03da40ac265b8ba3bd84d5223bcf6b.tar.bz2
CPack: use a distinct checksum file for each generator
Different CPack generators could produce checksum files with the same name which were overwritten by each other since only package name without extensions was used for checksum file name generation. This patch adds package extension to checksum files to prevent collisions. Fixes: #16840
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index e72fcc1..f56b5fa 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -999,8 +999,7 @@ int cmCPackGenerator::DoPackage()
/* Generate checksum file */
if (crypto.get() != nullptr) {
std::string hashFile(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
- hashFile +=
- "/" + filename.substr(0, filename.rfind(this->GetOutputExtension()));
+ hashFile += "/" + filename;
hashFile += "." + cmSystemTools::LowerCase(algo);
cmsys::ofstream outF(hashFile.c_str());
if (!outF) {