From 1b2dd29e8298270a96659082f3afffd06e9f9517 Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Fri, 3 Jan 2025 19:27:23 +0100 Subject: [PATCH] Retry hdiutil call in dmg build script See https://github.com/actions/runner-images/issues/7522#issuecomment-2530439754 --- tools/osx-dmg.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/osx-dmg.sh b/tools/osx-dmg.sh index 4c431a3c3e..873da6ff60 100755 --- a/tools/osx-dmg.sh +++ b/tools/osx-dmg.sh @@ -50,7 +50,15 @@ cp -v "${SRC_DIR}/packages/osx_bundle/Contents/Resources/Aegisub.icns" "${DMG_TM echo echo "---- Creating image ----" -/usr/bin/hdiutil create -srcfolder "${DMG_TMP_DIR}" -volname "${PKG_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "${DMG_RW_PATH}" +max_tries=10 +i=0 +until /usr/bin/hdiutil create -srcfolder "${DMG_TMP_DIR}" -volname "${PKG_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "${DMG_RW_PATH}"; do + if [ $i -eq $max_tries ]; then + echo "Error: hdiutil failed after ${max_tries} tries." + exit 1 + fi + i=$((i+1)) +done echo echo "---- Mounting image ----"