aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLeonid Pospelov <pospelovlm@yandex.ru>2019-09-23 23:03:59 +0200
committerVictor Romero <romerosanchezv@gmail.com>2019-09-23 14:03:59 -0700
commit6c7f1c76738be50529fa8f1857db426fd3ef1d56 (patch)
treeb5887c13f8f8dbf4c5f3a5811619eecda43b301b /scripts
parent02881e6c6dc40dd0dff3bb6a0a3fcbb66a661a70 (diff)
downloadvcpkg-6c7f1c76738be50529fa8f1857db426fd3ef1d56.tar.gz
vcpkg-6c7f1c76738be50529fa8f1857db426fd3ef1d56.zip
[vcpkg] Avoid RENAME usage to prevent cross-device link problems (#4245) (#8032)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_download_distfile.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake
index 1fbff40e5..887eb285f 100644
--- a/scripts/cmake/vcpkg_download_distfile.cmake
+++ b/scripts/cmake/vcpkg_download_distfile.cmake
@@ -75,11 +75,14 @@ function(vcpkg_download_distfile VAR)
# Works around issue #3399
if(IS_DIRECTORY "${DOWNLOADS}/temp")
+ # Delete "temp0" directory created by the old version of vcpkg
file(REMOVE_RECURSE "${DOWNLOADS}/temp0")
- file(RENAME "${DOWNLOADS}/temp" "${DOWNLOADS}/temp0")
- file(REMOVE_RECURSE "${DOWNLOADS}/temp0")
+
+ file(GLOB temp_files "${DOWNLOADS}/temp")
+ file(REMOVE_RECURSE ${temp_files})
+ else()
+ file(MAKE_DIRECTORY "${DOWNLOADS}/temp")
endif()
- file(MAKE_DIRECTORY "${DOWNLOADS}/temp")
function(test_hash FILE_PATH FILE_KIND CUSTOM_ERROR_ADVICE)
if(_VCPKG_INTERNAL_NO_HASH_CHECK)