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, master has been updated
       via  2d01dcab29aaa60e905e828d4a07d2f72f7eeb20 (commit)
       via  a38965db9a515c0f8af9035d6cca13cf684b406a (commit)
       via  e6c9a8bac3a2f3103ee79058e92dadd2d30c8ac5 (commit)
       via  2c71208a78f47f59972a3a39b1f038d293abd83b (commit)
      from  f8917685f32677c4055176d96bbd5a747da03fdb (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=2d01dcab29aaa60e905e828d4a07d2f72f7eeb20
commit 2d01dcab29aaa60e905e828d4a07d2f72f7eeb20
Merge: a38965d 2c71208
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Aug 30 14:43:00 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Aug 30 10:43:09 2019 -0400

    Merge topic 'rel-nightly-test'
    
    2c71208a78 Tests: Fix nightly binary tests to fail on error
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3755


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a38965db9a515c0f8af9035d6cca13cf684b406a
commit a38965db9a515c0f8af9035d6cca13cf684b406a
Merge: f891768 e6c9a8b
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Aug 30 14:38:17 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Aug 30 10:38:25 2019 -0400

    Merge topic 'remove_directory-symlink'
    
    e6c9a8bac3 cmake: Teach -E remove_directory to remove directory symlinks
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3738


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6c9a8bac3a2f3103ee79058e92dadd2d30c8ac5
commit e6c9a8bac3a2f3103ee79058e92dadd2d30c8ac5
Author:     Jon Chronopoulos <patc...@crondog.com>
AuthorDate: Mon Aug 26 14:21:12 2019 +1000
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri Aug 30 10:37:30 2019 -0400

    cmake: Teach -E remove_directory to remove directory symlinks
    
    If the argument to `remove_directory` is a symlink to a directory,
    remove the symlink instead.
    
    Issue: #19533

diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 0832e2f..fbbd47c 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -676,10 +676,17 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> 
const& args)
       // If an error occurs, we want to continue removing directories.
       bool return_value = false;
       for (auto const& arg : cmMakeRange(args).advance(2)) {
-        if (cmSystemTools::FileIsDirectory(arg) &&
-            !cmSystemTools::RemoveADirectory(arg)) {
-          std::cerr << "Error removing directory \"" << arg << "\".\n";
-          return_value = true;
+        if (cmSystemTools::FileIsDirectory(arg)) {
+          if (cmSystemTools::FileIsSymlink(arg)) {
+            if (!cmSystemTools::RemoveFile(arg)) {
+              std::cerr << "Error removing directory symlink \"" << arg
+                        << "\".\n";
+              return_value = true;
+            }
+          } else if (!cmSystemTools::RemoveADirectory(arg)) {
+            std::cerr << "Error removing directory \"" << arg << "\".\n";
+            return_value = true;
+          }
         }
       }
       return return_value;
diff --git 
a/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-check.cmake 
b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-check.cmake
new file mode 100644
index 0000000..f70312c
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-check.cmake
@@ -0,0 +1,6 @@
+if(EXISTS ${out}/link_dir)
+  set(RunCMake_TEST_FAILED "did not remove ${out}/link_dir")
+endif()
+if(NOT EXISTS ${out}/dir)
+  set(RunCMake_TEST_FAILED "should not have removed ${out}/dir")
+endif()
diff --git 
a/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-stderr.txt 
b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-stderr.txt
new file mode 100644
index 0000000..e69de29
diff --git 
a/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-check.cmake 
b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-check.cmake
new file mode 100644
index 0000000..23d7c6d
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-check.cmake
@@ -0,0 +1,6 @@
+if(NOT EXISTS ${outfile})
+  set(RunCMake_TEST_FAILED "removed non-directory ${outfile}")
+endif()
+if(NOT EXISTS ${out}/link_file_for_test.txt)
+  set(RunCMake_TEST_FAILED "removed non-directory symlink 
${out}/link_file_for_test.txt")
+endif()
diff --git 
a/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-stderr.txt 
b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-stderr.txt
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake 
b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index dd49423..2bc5966 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -348,6 +348,17 @@ run_cmake_command(E_make_directory-two-directories-and-file
   ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${outfile})
 run_cmake_command(E_remove_directory-two-directories-and-file
   ${CMAKE_COMMAND} -E remove_directory ${out}/d1 ${out}/d2 ${outfile})
+
+if(UNIX)
+  file(MAKE_DIRECTORY ${out}/dir)
+  file(CREATE_LINK ${out}/dir ${out}/link_dir SYMBOLIC)
+  file(CREATE_LINK ${outfile} ${out}/link_file_for_test.txt SYMBOLIC)
+  run_cmake_command(E_remove_directory-symlink-dir
+    ${CMAKE_COMMAND} -E remove_directory ${out}/link_dir)
+  run_cmake_command(E_remove_directory-symlink-file
+    ${CMAKE_COMMAND} -E remove_directory ${out}/link_file_for_test.txt)
+endif()
+
 unset(out)
 unset(outfile)
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c71208a78f47f59972a3a39b1f038d293abd83b
commit 2c71208a78f47f59972a3a39b1f038d293abd83b
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Aug 29 14:39:05 2019 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Aug 29 14:39:05 2019 -0400

    Tests: Fix nightly binary tests to fail on error
    
    We generate a small shell script to drive the steps.  Previously a
    failure in the `release_cmake.cmake` script was not diagnosed and hidden
    from the script exit code by the following upload step.  Tell the shell
    to terminate with failure on the first command that fails.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 02e28d4..cbd7d56 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -764,7 +764,8 @@ if(BUILD_TESTING)
     set(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}")
     file(MAKE_DIRECTORY "${_TEST_DIR}")
     file(WRITE "${_TEST_DIR}/nightly-cmake.sh"
-      "cd ${_TEST_DIR}
+      "set -e
+cd ${_TEST_DIR}
 ${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=nightly -P 
${CMake_SOURCE_DIR}/Utilities/Release/${script}
 ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- 
'${CMake_BUILD_NIGHTLY_RELEASES}'
     ")

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

Summary of changes:
 Source/cmcmd.cxx                                          | 15 +++++++++++----
 Tests/CMakeLists.txt                                      |  3 ++-
 .../E_remove_directory-symlink-dir-check.cmake            |  6 ++++++
 .../E_remove_directory-symlink-dir-stderr.txt}            |  0
 .../E_remove_directory-symlink-file-check.cmake           |  6 ++++++
 .../E_remove_directory-symlink-file-stderr.txt}           |  0
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake             | 11 +++++++++++
 7 files changed, 36 insertions(+), 5 deletions(-)
 create mode 100644 
Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-check.cmake
 copy Tests/{Wrapping/vtkIncluded.cxx => 
RunCMake/CommandLine/E_remove_directory-symlink-dir-stderr.txt} (100%)
 create mode 100644 
Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-check.cmake
 copy Tests/{Wrapping/vtkIncluded.cxx => 
RunCMake/CommandLine/E_remove_directory-symlink-file-stderr.txt} (100%)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to