Skip to content

Commit

Permalink
Download realm binaries to a random path (#2061)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev authored Oct 5, 2020
1 parent 8c38425 commit 89f8765
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wrappers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ function(download_realm_tarball url target libraries)
if (NOT EXISTS ${tarball_path})
if (NOT EXISTS ${temp_tarball_path})
message("Downloading ${url}.")
file(DOWNLOAD ${url} ${temp_tarball_path}.tmp SHOW_PROGRESS)
file(RENAME ${temp_tarball_path}.tmp ${temp_tarball_path})
string(RANDOM suffix)
set(temp_download_path "${temp_tarball_path}-${suffix}.tmp")
message("Downloading ${url} to ${temp_download_path}.")
file(DOWNLOAD ${url} ${temp_download_path} SHOW_PROGRESS)
if (NOT EXISTS ${temp_tarball_path})
file(RENAME ${temp_download_path} ${temp_tarball_path})
endif()
endif()
file(COPY ${temp_tarball_path} DESTINATION ${tarball_parent_directory})
endif()
Expand Down

0 comments on commit 89f8765

Please sign in to comment.