summaryrefslogtreecommitdiff
path: root/Source/cmArchiveWrite.cxx
diff options
context:
space:
mode:
authorBen Stone <21052-bens@users.noreply.gitlab.kitware.com>2020-06-02 17:27:02 +1000
committerBen Stone <21052-bens@users.noreply.gitlab.kitware.com>2020-06-02 17:27:02 +1000
commitc339e5380fcf734f5b15a273ac73862c9a0c08ad (patch)
tree54be24c2fb8dbb8533f0c5e6d1c2c9aa17539056 /Source/cmArchiveWrite.cxx
parent06f9be47b81e6e8e1c6ba8a0ca147460fa6cd87a (diff)
downloadcmake-c339e5380fcf734f5b15a273ac73862c9a0c08ad.tar.gz
CPack: Use SOURCE_DATE_EPOCH for all timestamps in archives
Diffstat (limited to 'Source/cmArchiveWrite.cxx')
-rw-r--r--Source/cmArchiveWrite.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 78bb6e07aa..addfbff3e4 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -282,7 +282,12 @@ bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix)
time_t epochTime;
iss >> epochTime;
if (iss.eof() && !iss.fail()) {
+ // Set all of the file times to the epoch time to handle archive
+ // formats that include creation/access time.
archive_entry_set_mtime(e, epochTime, 0);
+ archive_entry_set_atime(e, epochTime, 0);
+ archive_entry_set_ctime(e, epochTime, 0);
+ archive_entry_set_birthtime(e, epochTime, 0);
}
}
}