[Cmake-commits] CMake branch, next, updated. v2.8.1-1285-ga1239d5

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jun 3 10:54:19 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  a1239d50f68cc3dccc00c7303d8e46e40336ef02 (commit)
       via  85cbdaade22c7ba6dac7a806c0b88ebc32caa4c1 (commit)
       via  3ac3dea6f0eb1ce68b321020ecdd336b3db8a0fe (commit)
       via  eaee8a2cb17fb53fe4f721813b8ddae111a4a07a (commit)
      from  75cf2ef1fc8c8dfb848e50cbe7a6c65d9626a75f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1239d50f68cc3dccc00c7303d8e46e40336ef02
commit a1239d50f68cc3dccc00c7303d8e46e40336ef02
Merge: 75cf2ef 85cbdaa
Author: Brad King <brad.king at kitware.com>
Date:   Thu Jun 3 10:52:59 2010 -0400

    Merge branch 'file-write-umask' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85cbdaade22c7ba6dac7a806c0b88ebc32caa4c1
commit 85cbdaade22c7ba6dac7a806c0b88ebc32caa4c1
Author: Brad King <brad.king at kitware.com>
Date:   Thu Jun 3 10:46:38 2010 -0400

    Really trust umask in file(WRITE) command (#10789, #10126)
    
    Commit 8d0161c8 (Trust umask for file permissions, 2010-01-12) taught
    these commands to set permissions to 0666 explicitly.  The intention was
    to let the open() call inside ofstream handle permsisions so that umask
    would be honored.  Now we set permissions only when we need to preserve
    those on an existing file.  New files will be created with umask-based
    permissions.

diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 5611527..9bd84d8 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -183,24 +183,16 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
   std::string dir = cmSystemTools::GetFilenamePath(fileName);
   cmSystemTools::MakeDirectory(dir.c_str());
 
-  mode_t mode =
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
-    S_IREAD | S_IWRITE
-#elif defined( __BORLANDC__ )
-    S_IRUSR | S_IWUSR
-#else
-    0666
-#endif
-    ;
+  mode_t mode = 0;
 
   // Set permissions to writable
   if ( cmSystemTools::GetPermissions(fileName.c_str(), mode) )
     {
     cmSystemTools::SetPermissions(fileName.c_str(),
 #if defined( _MSC_VER ) || defined( __MINGW32__ )
-      S_IREAD | S_IWRITE
+      mode | S_IWRITE
 #else
-      0666
+      mode | S_IWUSR | S_IWGRP
 #endif
     );
     }
@@ -217,7 +209,10 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
     }
   file << message;
   file.close();
-  cmSystemTools::SetPermissions(fileName.c_str(), mode);
+  if(mode)
+    {
+    cmSystemTools::SetPermissions(fileName.c_str(), mode);
+    }
   return true;
 }
 
diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx
index f46b87f..ec558b6 100644
--- a/Source/cmWriteFileCommand.cxx
+++ b/Source/cmWriteFileCommand.cxx
@@ -54,24 +54,16 @@ bool cmWriteFileCommand
   std::string dir = cmSystemTools::GetFilenamePath(fileName);
   cmSystemTools::MakeDirectory(dir.c_str());
 
-  mode_t mode =
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
-    S_IREAD | S_IWRITE
-#elif defined( __BORLANDC__ )
-    S_IRUSR | S_IWUSR
-#else
-    0666
-#endif
-    ;
+  mode_t mode = 0;
 
   // Set permissions to writable
   if ( cmSystemTools::GetPermissions(fileName.c_str(), mode) )
     {
     cmSystemTools::SetPermissions(fileName.c_str(),
 #if defined( _MSC_VER ) || defined( __MINGW32__ )
-      S_IREAD | S_IWRITE
+      mode | S_IWRITE
 #else
-      0666
+      mode | S_IWUSR | S_IWGRP
 #endif
     );
     }
@@ -89,7 +81,10 @@ bool cmWriteFileCommand
     }
   file << message << std::endl;
   file.close();
-  cmSystemTools::SetPermissions(fileName.c_str(), mode);
+  if(mode)
+    {
+    cmSystemTools::SetPermissions(fileName.c_str(), mode);
+    }
 
   return true;
 }

-----------------------------------------------------------------------

Summary of changes:
 Source/cmFileCommand.cxx          |   19 +++++++------------
 Source/cmWriteFileCommand.cxx     |   19 +++++++------------
 Source/kwsys/kwsysDateStamp.cmake |    2 +-
 3 files changed, 15 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list