1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 23:29:41 +02:00
audacity/scripts/ci/macos/repeat_hdiutil.sh
Emily Mabrey 7450432f9a
Attempt to fix macOS build issues
Add `umount` command behavior
Modify to retry 12 times over the course of 240 seconds total
Change `scripts\build\macOS\DMGSetup.scpt` to close DMG when finished.
Improve system detection for setting project name.

Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org>
2021-09-06 02:06:04 -04:00

27 lines
653 B
Bash
Executable File

#!/usr/bin/env bash
((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "$0: Error: Please upgrade Bash."; exit 1; }
set -uo pipefail
max_retry=12
counter=0
num_secs_await_retry=20
echo "Trying: /usr/bin/hdiutil $@"
until /usr/bin/hdiutil "$@"; do
sleep $num_secs_await_retry
if [[ $counter -eq $max_retry ]]; then
echo "CPack failed despite retry attempts!"
exit 1
else
echo "Attempting to umount before retry..."
modified_args=("$@")
modified_args[0]="umount"
/usr/bin/hdiutil "${modified_args[@]}"
echo "Trying hdiutil call again. Retry attempt #$counter"
((counter++))
fi
done