cmake: Teach "-E tar" command a "--mtime=" option

Add an option to set the mtime of entries in a tarball so that one can
create a tarball with a consistent content hash (e.g. MD5) for a given
set of files regardless of their current timestamps on disk.  This will
be useful for submission of tarballs to CDash, which tracks content
hashes to avoid duplication.

Inspired-by: Bill Hoffman <bill.hoffman@kitware.com>
This commit is contained in:
Brad King
2015-01-14 13:22:29 -05:00
parent 90f9c42732
commit 3a60c899fc
16 changed files with 112 additions and 6 deletions
+3 -3
View File
@@ -394,9 +394,9 @@ public:
bool verbose);
static bool CreateTar(const char* outFileName,
const std::vector<std::string>& files,
cmTarCompression compressType, bool verbose);
static bool ExtractTar(const char* inFileName,
bool verbose);
cmTarCompression compressType, bool verbose,
std::string const& mtime = std::string());
static bool ExtractTar(const char* inFileName, bool verbose);
// This should be called first thing in main
// it will keep child processes from inheriting the
// stdin and stdout of this process. This is important