diff options
author | Gusts Kaksis <gkaksis@whitecryption.com> | 2017-07-20 11:43:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-07-20 15:22:03 (GMT) |
commit | 351c1b1ad6d68c9c029ae9d92f656b467cd350d0 (patch) | |
tree | 6662e918df8f67fdf3e6dc73adab0831e8fb1195 /Source/CPack/cmCPackDragNDropGenerator.cxx | |
parent | f6a85bdbb19c4d8124f683db17c634fa48a62c02 (diff) | |
download | CMake-351c1b1ad6d68c9c029ae9d92f656b467cd350d0.zip CMake-351c1b1ad6d68c9c029ae9d92f656b467cd350d0.tar.gz CMake-351c1b1ad6d68c9c029ae9d92f656b467cd350d0.tar.bz2 |
CPack: Pass volume mount name to AppleScript instead of volume name.
Get the mount name from mount point path returned by hdiutil instead of
assuming it is the volume name. They can be different in case of
conflict with an already-mounted volume.
Diffstat (limited to 'Source/CPack/cmCPackDragNDropGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackDragNDropGenerator.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 9864cf3..d4d2fdb 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -447,6 +447,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, cmsys::RegularExpression mountpoint_regex(".*(/Volumes/[^\n]+)\n.*"); mountpoint_regex.find(attach_output.c_str()); std::string const temp_mount = mountpoint_regex.match(1); + std::string const temp_mount_name = + temp_mount.substr(sizeof("/Volumes/") - 1); // Remove dummy padding file so we have enough space on RW image ... std::ostringstream dummy_padding; @@ -480,7 +482,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::ostringstream setup_script_command; setup_script_command << "osascript" << " \"" << cpack_dmg_ds_store_setup_script << "\"" - << " \"" << cpack_dmg_volume_name << "\""; + << " \"" << temp_mount_name << "\""; std::string error; if (!this->RunCommand(setup_script_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, |