summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorAlexey Rogachevskiy <sfalexrog@gmail.com>2021-06-30 12:23:07 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-30 12:47:59 (GMT)
commit9028195a22514ca008c3aae5de0e58e1a112e34e (patch)
treeed99905e90b8e7802dbd37294f6585082a1e1838 /Source/CPack
parent82183329a5ea8c2ef0158bf6f94946741c189723 (diff)
downloadCMake-9028195a22514ca008c3aae5de0e58e1a112e34e.zip
CMake-9028195a22514ca008c3aae5de0e58e1a112e34e.tar.gz
CMake-9028195a22514ca008c3aae5de0e58e1a112e34e.tar.bz2
CPackDeb: sort package files before generating deb file
This should make the order in which the files are added to md5sums and archives is stable, thus making package files more reproducible. Fixes: #22361
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 006d66d..db30a0d 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackDebGenerator.h"
+#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <map>
@@ -525,6 +526,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
return 0;
}
this->packageFiles = gl.GetFiles();
+ // Sort files so that they have a reproducible order
+ std::sort(this->packageFiles.begin(), this->packageFiles.end());
}
int res = this->createDeb();
@@ -551,6 +554,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
return 0;
}
this->packageFiles = gl.GetFiles();
+ // Sort files so that they have a reproducible order
+ std::sort(this->packageFiles.begin(), this->packageFiles.end());
res = this->createDbgsymDDeb();
if (res != 1) {
@@ -672,6 +677,8 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
return 0;
}
this->packageFiles = gl.GetFiles();
+ // Sort files so that they have a reproducible order
+ std::sort(this->packageFiles.begin(), this->packageFiles.end());
int res = this->createDeb();
if (res != 1) {