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  99bf0b1ef2d509ead3d2ab7238dced2a3c37f659 (commit)
       via  df15f0f69436264e9e6160a42a2368369d78b740 (commit)
      from  0d367b05485e89386f9c60584688b737ba62fc0b (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=99bf0b1ef2d509ead3d2ab7238dced2a3c37f659
commit 99bf0b1ef2d509ead3d2ab7238dced2a3c37f659
Merge: 0d367b0 df15f0f
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Mon Nov 3 13:09:15 2014 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Nov 3 13:09:15 2014 -0500

    Merge topic 'file-GENERATE-permissions' into next
    
    df15f0f6 file(GENERATE): Use permissions of input file if present.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df15f0f69436264e9e6160a42a2368369d78b740
commit df15f0f69436264e9e6160a42a2368369d78b740
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Tue Jul 22 15:10:57 2014 +0200
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Mon Nov 3 19:08:28 2014 +0100

    file(GENERATE): Use permissions of input file if present.

diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx 
b/Source/cmGeneratorExpressionEvaluationFile.cxx
index f9067cf..3a8dc48 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -36,7 +36,7 @@ 
cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
 //----------------------------------------------------------------------------
 void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
               cmCompiledGeneratorExpression* inputExpression,
-              std::map<std::string, std::string> &outputFiles)
+              std::map<std::string, std::string> &outputFiles, mode_t perm)
 {
   std::string rawCondition = this->Condition->GetInput();
   if (!rawCondition.empty())
@@ -83,11 +83,16 @@ void cmGeneratorExpressionEvaluationFile::Generate(const 
std::string& config,
   cmGeneratedFileStream fout(outputFileName.c_str());
   fout.SetCopyIfDifferent(true);
   fout << outputContent;
+  if (fout.Close() && perm)
+    {
+    cmSystemTools::SetPermissions(outputFileName.c_str(), perm);
+    }
 }
 
 //----------------------------------------------------------------------------
 void cmGeneratorExpressionEvaluationFile::Generate()
 {
+  mode_t perm = 0;
   std::string inputContent;
   if (this->InputIsContent)
     {
@@ -95,6 +100,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
     }
   else
     {
+    cmSystemTools::GetPermissions(this->Input.c_str(), perm);
     cmsys::ifstream fin(this->Input.c_str());
     if(!fin)
       {
@@ -131,7 +137,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
   for(std::vector<std::string>::const_iterator li = allConfigs.begin();
       li != allConfigs.end(); ++li)
     {
-    this->Generate(*li, inputExpression.get(), outputFiles);
+    this->Generate(*li, inputExpression.get(), outputFiles, perm);
     if(cmSystemTools::GetFatalErrorOccured())
       {
       return;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h 
b/Source/cmGeneratorExpressionEvaluationFile.h
index f939916..4e87a88 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -34,7 +34,7 @@ public:
 private:
   void Generate(const std::string& config,
               cmCompiledGeneratorExpression* inputExpression,
-              std::map<std::string, std::string> &outputFiles);
+              std::map<std::string, std::string> &outputFiles, mode_t perm);
 
 private:
   const std::string Input;

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

Summary of changes:
 Source/cmGeneratorExpressionEvaluationFile.cxx |   10 ++++++++--
 Source/cmGeneratorExpressionEvaluationFile.h   |    2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to