[Cmake-commits] CMake branch, next, updated. v3.5.2-1465-g8a17b4a

Brad King brad.king at kitware.com
Tue May 17 14:47:51 EDT 2016


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  8a17b4a96e19c6ab56266f61913da61e795fb938 (commit)
       via  af3d76b3eb2981178260916d919b0b07ee8e4d55 (commit)
       via  40bee43a58f69848c1492f6fc53aecef363be95c (commit)
      from  674c838e2c93ae2b97ca1ca8defbb1697911d0f3 (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=8a17b4a96e19c6ab56266f61913da61e795fb938
commit 8a17b4a96e19c6ab56266f61913da61e795fb938
Merge: 674c838 af3d76b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 17 14:47:50 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 17 14:47:50 2016 -0400

    Merge topic 'cpack-dmg-attach-wait' into next
    
    af3d76b3 CPack/DragNDrop: Wait for temporary volume to appear before using it
    40bee43a cmCPackDragNDropGenerator: Replace std::{ostringstream => string}


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af3d76b3eb2981178260916d919b0b07ee8e4d55
commit af3d76b3eb2981178260916d919b0b07ee8e4d55
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 17 13:54:55 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 17 14:21:44 2016 -0400

    CPack/DragNDrop: Wait for temporary volume to appear before using it
    
    The `hdituil attach` command appears to return before the volume is
    ready for use.  Wait up to 5 seconds for the volume to appear.

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 9576eff..fb3c71c 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -449,10 +449,23 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     mountpoint_regex.find(attach_output.c_str());
     std::string const temp_mount = mountpoint_regex.match(1);
 
+    // Wait for the volume to actually appear.
+    int wait_tries = 5;
+    while (!cmSystemTools::FileIsDirectory(temp_mount) && --wait_tries) {
+      cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Waiting for volume to appear: "
+                      << temp_mount << std::endl);
+      cmSystemTools::Delay(1000);
+    }
+    if (wait_tries == 0) {
+      cmCPackLogger(cmCPackLog::LOG_ERROR, "Temporary volume did not appear: "
+                      << temp_mount << std::endl);
+      had_error = true;
+    }
+
     // Remove dummy padding file so we have enough space on RW image ...
     std::ostringstream dummy_padding;
     dummy_padding << temp_mount << "/.dummy-padding-file";
-    if (!cmSystemTools::RemoveFile(dummy_padding.str())) {
+    if (!had_error && !cmSystemTools::RemoveFile(dummy_padding.str())) {
       cmCPackLogger(cmCPackLog::LOG_ERROR, "Error removing dummy padding file."
                       << std::endl);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40bee43a58f69848c1492f6fc53aecef363be95c
commit 40bee43a58f69848c1492f6fc53aecef363be95c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 17 13:47:21 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 17 13:47:21 2016 -0400

    cmCPackDragNDropGenerator: Replace std::{ostringstream => string}

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index e401657..9576eff 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -447,12 +447,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
 
     cmsys::RegularExpression mountpoint_regex(".*(/Volumes/[^\n]+)\n.*");
     mountpoint_regex.find(attach_output.c_str());
-    std::ostringstream temp_mount;
-    temp_mount << mountpoint_regex.match(1);
+    std::string const temp_mount = mountpoint_regex.match(1);
 
     // Remove dummy padding file so we have enough space on RW image ...
     std::ostringstream dummy_padding;
-    dummy_padding << temp_mount.str() << "/.dummy-padding-file";
+    dummy_padding << temp_mount << "/.dummy-padding-file";
     if (!cmSystemTools::RemoveFile(dummy_padding.str())) {
       cmCPackLogger(cmCPackLog::LOG_ERROR, "Error removing dummy padding file."
                       << std::endl);
@@ -465,7 +464,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
       std::ostringstream setfile_command;
       setfile_command << this->GetOption("CPACK_COMMAND_SETFILE");
       setfile_command << " -a C";
-      setfile_command << " \"" << temp_mount.str() << "\"";
+      setfile_command << " \"" << temp_mount << "\"";
 
       if (!this->RunCommand(setfile_command)) {
         cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -497,7 +496,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     std::ostringstream detach_command;
     detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
     detach_command << " detach";
-    detach_command << " \"" << temp_mount.str() << "\"";
+    detach_command << " \"" << temp_mount << "\"";
 
     if (!this->RunCommand(detach_command)) {
       cmCPackLogger(cmCPackLog::LOG_ERROR,

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

Summary of changes:
 Source/CPack/cmCPackDragNDropGenerator.cxx |   24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list