[Cmake-commits] CMake branch, next, updated. v3.3.2-3275-g477a804

Brad King brad.king at kitware.com
Fri Sep 25 11:59:10 EDT 2015


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  477a8047d3de7ec07e54ddd0f9717eb574f6bc7a (commit)
       via  320460699063f83ea959d89f4f03d026108e3109 (commit)
      from  ff41c88af4590a4b076c77e15aa7d640eb9f7396 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=477a8047d3de7ec07e54ddd0f9717eb574f6bc7a
commit 477a8047d3de7ec07e54ddd0f9717eb574f6bc7a
Merge: ff41c88 3204606
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 25 11:59:09 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Sep 25 11:59:09 2015 -0400

    Merge topic 'cpack-empty-dirs-handling-fix' into next
    
    32046069 Revert topic 'cpack-empty-dirs-handling-fix'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=320460699063f83ea959d89f4f03d026108e3109
commit 320460699063f83ea959d89f4f03d026108e3109
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 25 11:58:54 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 25 11:58:54 2015 -0400

    Revert topic 'cpack-empty-dirs-handling-fix'
    
    The original 'cpack-package-empty-dirs' will also be reverted
    until these fixes can be organized and changes from KWSys
    integrated.

diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 49f9cb5..04b1976 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -411,33 +411,6 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
           symlinkedFiles.push_back(std::pair<std::string,
                                    std::string>(targetFile,inFileRelative));
           }
-        else if(cmSystemTools::FileIsDirectory(inFile))
-          {
-          bool dirExists = cmSystemTools::FileExists(filePath);
-          mode_t perm = 0;
-          bool perms = cmSystemTools::GetPermissions(inFile, perm);
-          mode_t destPerm = 0;
-          bool destPerms = false;
-
-          if(dirExists)
-            {
-            destPerms = cmSystemTools::GetPermissions(filePath, destPerm);
-            }
-
-          // create only if dir doesn't exist or dirs differ
-          if(!dirExists || perms != destPerms || perm != destPerm)
-            {
-            if(!cmSystemTools::MakeDirectory(filePath) ||
-                (perms && !cmSystemTools::SetPermissions(filePath, perm)) ||
-                !cmSystemTools::CopyFileTime(inFile.c_str(), filePath.c_str()))
-              {
-              cmCPackLogger(cmCPackLog::LOG_ERROR,
-                            "Problem creating directory: "
-                            << filePath << std::endl);
-              return 0;
-              }
-            }
-          }
         /* If it is not a symlink then do a plain copy */
         else if (!(
             cmSystemTools::CopyFileIfDifferent(inFile.c_str(),filePath.c_str())
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index d3c1f16..c24b5ea 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -895,12 +895,33 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname,
 
 bool cmSystemTools::cmCopyFile(const char* source, const char* destination)
 {
+  // FIXME remove if statement once kwsys SystemTools get support for
+  // source is directory handling in CopyFileAlways function
+  if(cmSystemTools::FileIsDirectory(source))
+    {
+    return Superclass::MakeDirectory(destination);
+    }
+
   return Superclass::CopyFileAlways(source, destination);
 }
 
 bool cmSystemTools::CopyFileIfDifferent(const char* source,
   const char* destination)
 {
+  // FIXME remove if statement once kwsys SystemTools get support for
+  // source is directory handling in CopyFileIfDifferent function
+  if(cmSystemTools::FileIsDirectory(source))
+    {
+    if(SystemTools::FileExists(destination))
+      {
+      return true;
+      }
+    else
+      {
+      return Superclass::MakeDirectory(destination);
+      }
+    }
+
   return Superclass::CopyFileIfDifferent(source, destination);
 }
 
@@ -2045,11 +2066,10 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile)
   cmSystemToolsWindowsHandle hFrom =
     CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fromFile).c_str(),
                 GENERIC_READ, FILE_SHARE_READ, 0,
-                OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
+                OPEN_EXISTING, 0, 0);
   cmSystemToolsWindowsHandle hTo =
     CreateFileW(SystemTools::ConvertToWindowsExtendedPath(toFile).c_str(),
-                FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING,
-                FILE_FLAG_BACKUP_SEMANTICS, 0);
+                GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
   if(!hFrom || !hTo)
     {
     return false;
@@ -2101,8 +2121,7 @@ bool cmSystemTools::FileTimeGet(const char* fname, cmSystemToolsFileTime* t)
 #if defined(_WIN32) && !defined(__CYGWIN__)
   cmSystemToolsWindowsHandle h =
     CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(),
-                GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING,
-                FILE_FLAG_BACKUP_SEMANTICS, 0);
+                GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
   if(!h)
     {
     return false;
@@ -2129,8 +2148,7 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t)
 #if defined(_WIN32) && !defined(__CYGWIN__)
   cmSystemToolsWindowsHandle h =
     CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(),
-                FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING,
-                FILE_FLAG_BACKUP_SEMANTICS, 0);
+                GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
   if(!h)
     {
     return false;

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

Summary of changes:
 Source/CPack/cmCPackGenerator.cxx |   27 ---------------------------
 Source/cmSystemTools.cxx          |   32 +++++++++++++++++++++++++-------
 2 files changed, 25 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list