[Cmake-commits] [cmake-commits] david.cole committed cmFileCommand.cxx 1.113 1.114

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Dec 18 10:43:25 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv30487

Modified Files:
	cmFileCommand.cxx 
Log Message:
BUG: Do not copy permissions of files when making the copy in an install rule. If the source file was read-only, this prevents the subsequent set of the destination file's modification time, making the copied file always different in time-stamp than the original and always installing a new file with a new time stamp (but the same content) causing unnecessary downstream incremental rebuilds. As part of this fix, add an optional copyPermissions parameter to the SystemTools routines CopyFileIfDifferent, CopyFileAlways, CopyAFile and CopyADirectory. The copyPermissions parameter defaults to true to preserve the behavior of these routines for existing callers.


Index: cmFileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.cxx,v
retrieving revision 1.113
retrieving revision 1.114
diff -C 2 -d -r1.113 -r1.114
*** cmFileCommand.cxx	11 Sep 2008 18:34:04 -0000	1.113
--- cmFileCommand.cxx	18 Dec 2008 15:43:23 -0000	1.114
***************
*** 1050,1054 ****
  
    // Copy the file.
!   if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true))
      {
      cmOStringStream e;
--- 1050,1054 ----
  
    // Copy the file.
!   if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true, false))
      {
      cmOStringStream e;
***************
*** 1065,1069 ****
    if(copy && !always)
      {
!     cmSystemTools::CopyFileTime(fromFile, toFile);
      }
  
--- 1065,1075 ----
    if(copy && !always)
      {
!     if (!cmSystemTools::CopyFileTime(fromFile, toFile))
!       {
!       cmOStringStream e;
!       e << "Problem setting modification time on file \"" << toFile << "\"";
!       this->FileCommand->SetError(e.str().c_str());
!       return false;
!       }
      }
  



More information about the Cmake-commits mailing list