1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Add a wrapper that retries hdiutil with progressive timeout

This seems to be a common workaround for CPack issue on macOS. 

Script has 10 attempts and in the worst case it will take 55 seconds for it to fail.
This commit is contained in:
Dmitry Vedenko 2021-07-28 15:35:52 +03:00
parent 314eaa40d7
commit e3e6d56846
2 changed files with 23 additions and 0 deletions

View File

@ -49,6 +49,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
elseif( CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
set( CPACK_GENERATOR DragNDrop )
set( CPACK_COMMAND_HDIUTIL "${CMAKE_SOURCE_DIR}/scripts/build/macOS/hdiutil_wrapper.sh" )
set( CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/mac/Resources/Audacity-DMG-background.png")
set( CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_SOURCE_DIR}/scripts/build/macOS/DMGSetup.scpt")

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# A special wrapper for hdiutil, that retries hdiutil call with
# the progressive timeout.
# This seems to be the common workaround for the CPack problem
counter=0
max_retries=10
hdiutil $@
while [ $? -ne 0 ]; do
((counter++))
if [[ $counter -eq $max_retries ]]; then
exit 1
fi
sleep $counter
hdiutil $@
done