From 6c7f1c76738be50529fa8f1857db426fd3ef1d56 Mon Sep 17 00:00:00 2001 From: Leonid Pospelov Date: Mon, 23 Sep 2019 23:03:59 +0200 Subject: [vcpkg] Avoid RENAME usage to prevent cross-device link problems (#4245) (#8032) --- scripts/cmake/vcpkg_download_distfile.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts/cmake') 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) -- cgit v1.2.3