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  0beaa3508ad731dc0ca1b198b0a5a28b60e682ca (commit)
       via  610464c12e0ef71b2bea28973b70630c4ce9a70e (commit)
      from  6d64981a1e9a676ea076f9d4420e536f7b108dbc (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=0beaa3508ad731dc0ca1b198b0a5a28b60e682ca
commit 0beaa3508ad731dc0ca1b198b0a5a28b60e682ca
Merge: 6d64981 610464c
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Mar 20 10:38:02 2015 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Fri Mar 20 10:38:02 2015 -0400

    Merge topic 'autogen-write-access' into next
    
    610464c1 QtAutogen: Ensure write access to AutogenInfo.cmake (#15416)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=610464c12e0ef71b2bea28973b70630c4ce9a70e
commit 610464c12e0ef71b2bea28973b70630c4ce9a70e
Author:     Justin Borodinsky <justin.borodin...@gmail.com>
AuthorDate: Wed Mar 18 20:30:26 2015 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri Mar 20 10:33:52 2015 -0400

    QtAutogen: Ensure write access to AutogenInfo.cmake (#15416)
    
    ConfigureFile uses the input file permissions, but we require write
    access in cmQtAutoGenerators::SetupAutoGenerateTarget to append to the
    file.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 42c18f7..08092c7 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -22,6 +22,8 @@
 # include "cmLocalVisualStudioGenerator.h"
 #endif
 
+#include <sys/stat.h>
+
 #include <cmsys/Terminal.h>
 #include <cmsys/ios/sstream>
 #include <cmsys/FStream.hxx>
@@ -582,6 +584,18 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget 
const* target)
   makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(),
                           false, true, false);
 
+  // Ensure we have write permission in case .in was read-only.
+  mode_t perm = 0;
+#if defined(WIN32) && !defined(__CYGWIN__)
+  mode_t mode_write = S_IWRITE;
+#else
+  mode_t mode_write = S_IWUSR;
+#endif
+  cmSystemTools::GetPermissions(outputFile, perm);
+  if (!(perm & mode_write))
+    {
+    cmSystemTools::SetPermissions(outputFile, perm | mode_write);
+    }
   if (!configDefines.empty()
       || !configIncludes.empty()
       || !configUicOptions.empty())

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

Summary of changes:
 Source/cmQtAutoGenerators.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)


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

Reply via email to