diff options
author | Brad King <brad.king@kitware.com> | 2010-06-04 19:53:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-06-04 19:53:48 (GMT) |
commit | b180bad2c663882dd339f670053f1bb7fc3769da (patch) | |
tree | 36ce08cf4ee3633b985fa0ea45d0e59fd27cc001 /Source | |
parent | 5f4ac98bc5c2c208b8c34c2b12b6b3a7ca9e8c91 (diff) | |
parent | b8a1319c354b7f257e6c0b82e428cfe94dcbf4ff (diff) | |
download | CMake-b180bad2c663882dd339f670053f1bb7fc3769da.zip CMake-b180bad2c663882dd339f670053f1bb7fc3769da.tar.gz CMake-b180bad2c663882dd339f670053f1bb7fc3769da.tar.bz2 |
Merge branch 'file-time-permissions'
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 5611527..60a81f3 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1507,7 +1507,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, this->ReportCopy(toFile, TypeFile, copy); // Copy the file. - if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true, false)) + if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true)) { cmOStringStream e; e << this->Name << " cannot copy file \"" << fromFile @@ -1519,6 +1519,13 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, // Set the file modification time of the destination file. if(copy && !this->Always) { + // Add write permission so we can set the file time. + // Permissions are set unconditionally below anyway. + mode_t perm = 0; + if(cmSystemTools::GetPermissions(toFile, perm)) + { + cmSystemTools::SetPermissions(toFile, perm | mode_owner_write); + } if (!cmSystemTools::CopyFileTime(fromFile, toFile)) { cmOStringStream e; |