[Cmake-commits] CMake branch, next, updated. v3.3.2-3290-gc645a4f

Brad King brad.king at kitware.com
Sat Sep 26 10:44:34 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  c645a4f94e9e56130e85cec63b53f656876b173b (commit)
       via  946e86151915d9f55e432fb8b3672c3106f0cdd8 (commit)
       via  29ad06947244d1a0f04deaf5360e2f1d1765d903 (commit)
      from  f09a9eccacc66592011dd93f4a9cd90f74c0ad73 (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=c645a4f94e9e56130e85cec63b53f656876b173b
commit c645a4f94e9e56130e85cec63b53f656876b173b
Merge: f09a9ec 946e861
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sat Sep 26 10:44:33 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Sep 26 10:44:33 2015 -0400

    Merge topic 'update-kwsys' into next
    
    946e8615 Merge branch 'upstream-kwsys' into update-kwsys
    29ad0694 KWSys 2015-09-25 (dc4e4a55)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=946e86151915d9f55e432fb8b3672c3106f0cdd8
commit 946e86151915d9f55e432fb8b3672c3106f0cdd8
Merge: 64b7baa 29ad069
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sat Sep 26 10:42:35 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Sep 26 10:42:35 2015 -0400

    Merge branch 'upstream-kwsys' into update-kwsys


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29ad06947244d1a0f04deaf5360e2f1d1765d903
commit 29ad06947244d1a0f04deaf5360e2f1d1765d903
Author:     KWSys Robot <kwrobot at kitware.com>
AuthorDate: Fri Sep 25 08:46:41 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Sep 26 10:42:29 2015 -0400

    KWSys 2015-09-25 (dc4e4a55)
    
    Extract upstream KWSys using the following shell commands.
    
    $ git archive --prefix=upstream-kwsys/ dc4e4a55 | tar x
    $ git shortlog --no-merges --abbrev=8 --format='%h %s' cfeb27cc..dc4e4a55
    Ben Boeckel (1):
          dd466688 CTestCustom: use list(APPEND)
    
    Domen Vrankar (1):
          dc4e4a55 SystemTools: Handle directories in CopyFile{Always,IfDifferent}

diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index d6f802e..760221b 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -9,7 +9,6 @@
 # resulting memory leaks are not logged by valgrind anyway.  Therefore, we
 # don't have to exclude it.
 
-set(CTEST_CUSTOM_MEMCHECK_IGNORE
-  ${CTEST_CUSTOM_MEMCHECK_IGNORE}
+list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
   kwsys.testProcess-10
   )
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 3857e41..80289b8 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -2365,95 +2365,102 @@ bool SystemTools::CopyFileAlways(const std::string& source, const std::string& d
     }
   mode_t perm = 0;
   bool perms = SystemTools::GetPermissions(source, perm);
-
-  const int bufferSize = 4096;
-  char buffer[bufferSize];
-
-  // If destination is a directory, try to create a file with the same
-  // name as the source in that directory.
-
   std::string real_destination = destination;
-  std::string destination_dir;
-  if(SystemTools::FileExists(destination) &&
-     SystemTools::FileIsDirectory(destination))
+
+  if(SystemTools::FileIsDirectory(source))
     {
-    destination_dir = real_destination;
-    SystemTools::ConvertToUnixSlashes(real_destination);
-    real_destination += '/';
-    std::string source_name = source;
-    real_destination += SystemTools::GetFilenameName(source_name);
+    SystemTools::MakeDirectory(destination);
     }
   else
     {
-    destination_dir = SystemTools::GetFilenamePath(destination);
-    }
+    const int bufferSize = 4096;
+    char buffer[bufferSize];
+
+    // If destination is a directory, try to create a file with the same
+    // name as the source in that directory.
+
+    std::string destination_dir;
+    if(SystemTools::FileExists(destination) &&
+       SystemTools::FileIsDirectory(destination))
+      {
+      destination_dir = real_destination;
+      SystemTools::ConvertToUnixSlashes(real_destination);
+      real_destination += '/';
+      std::string source_name = source;
+      real_destination += SystemTools::GetFilenameName(source_name);
+      }
+    else
+      {
+      destination_dir = SystemTools::GetFilenamePath(destination);
+      }
 
-  // Create destination directory
+    // Create destination directory
 
-  SystemTools::MakeDirectory(destination_dir);
+    SystemTools::MakeDirectory(destination_dir);
 
-  // Open files
+    // Open files
 #if defined(_WIN32)
-  kwsys::ifstream fin(Encoding::ToNarrow(
-    SystemTools::ConvertToWindowsExtendedPath(source)).c_str(),
-                std::ios::in | std::ios::binary);
+    kwsys::ifstream fin(Encoding::ToNarrow(
+      SystemTools::ConvertToWindowsExtendedPath(source)).c_str(),
+                  std::ios::in | std::ios::binary);
 #else
-  kwsys::ifstream fin(source.c_str(),
-                std::ios::in | std::ios::binary);
+    kwsys::ifstream fin(source.c_str(),
+                  std::ios::in | std::ios::binary);
 #endif
-  if(!fin)
-    {
-    return false;
-    }
+    if(!fin)
+      {
+      return false;
+      }
 
-  // try and remove the destination file so that read only destination files
-  // can be written to.
-  // If the remove fails continue so that files in read only directories
-  // that do not allow file removal can be modified.
-  SystemTools::RemoveFile(real_destination);
+    // try and remove the destination file so that read only destination files
+    // can be written to.
+    // If the remove fails continue so that files in read only directories
+    // that do not allow file removal can be modified.
+    SystemTools::RemoveFile(real_destination);
 
 #if defined(_WIN32)
-  kwsys::ofstream fout(Encoding::ToNarrow(
-    SystemTools::ConvertToWindowsExtendedPath(real_destination)).c_str(),
+    kwsys::ofstream fout(Encoding::ToNarrow(
+      SystemTools::ConvertToWindowsExtendedPath(real_destination)).c_str(),
                      std::ios::out | std::ios::trunc | std::ios::binary);
 #else
-  kwsys::ofstream fout(real_destination.c_str(),
+    kwsys::ofstream fout(real_destination.c_str(),
                      std::ios::out | std::ios::trunc | std::ios::binary);
 #endif
-  if(!fout)
-    {
-    return false;
-    }
-
-  // This copy loop is very sensitive on certain platforms with
-  // slightly broken stream libraries (like HPUX).  Normally, it is
-  // incorrect to not check the error condition on the fin.read()
-  // before using the data, but the fin.gcount() will be zero if an
-  // error occurred.  Therefore, the loop should be safe everywhere.
-  while(fin)
-    {
-    fin.read(buffer, bufferSize);
-    if(fin.gcount())
+    if(!fout)
       {
-      fout.write(buffer, fin.gcount());
+      return false;
       }
-    else
+
+    // This copy loop is very sensitive on certain platforms with
+    // slightly broken stream libraries (like HPUX).  Normally, it is
+    // incorrect to not check the error condition on the fin.read()
+    // before using the data, but the fin.gcount() will be zero if an
+    // error occurred.  Therefore, the loop should be safe everywhere.
+    while(fin)
       {
-      break;
+      fin.read(buffer, bufferSize);
+      if(fin.gcount())
+        {
+        fout.write(buffer, fin.gcount());
+        }
+      else
+        {
+        break;
+        }
       }
-    }
 
-  // Make sure the operating system has finished writing the file
-  // before closing it.  This will ensure the file is finished before
-  // the check below.
-  fout.flush();
+    // Make sure the operating system has finished writing the file
+    // before closing it.  This will ensure the file is finished before
+    // the check below.
+    fout.flush();
 
-  fin.close();
-  fout.close();
+    fin.close();
+    fout.close();
 
-  if(!fout)
-    {
-    return false;
+    if(!fout)
+      {
+      return false;
+      }
     }
   if ( perms )
     {

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

Summary of changes:
 Source/kwsys/CTestCustom.cmake.in |    3 +-
 Source/kwsys/SystemTools.cxx      |  135 +++++++++++++++++++------------------
 2 files changed, 72 insertions(+), 66 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list