From 26fa614d018b88ac8d80ba05e38d7a6ecf508bab Mon Sep 17 00:00:00 2001 From: XU Pengfei Date: Mon, 27 Jul 2026 23:32:16 +0900 Subject: [PATCH] macos_sign.sh: shrink signed DMG before conversion (#3649) Without the final shrinking pass, diskutil verifyVolume errors with "Invalid number of allocation blocks", which causes issues for non-interactive mounting in package managers. --- scripts/macos_sign.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/macos_sign.sh b/scripts/macos_sign.sh index 9d0b0c0c..c9f23a40 100755 --- a/scripts/macos_sign.sh +++ b/scripts/macos_sign.sh @@ -108,9 +108,17 @@ resign_dmg() { notarize_bundle Cutter-rw/Cutter.app unmount trap - EXIT + # Remove temporary signing space and restore HFS+ volume consistency. + ee hdiutil resize -size min Cutter-rw.dmg OUTPUT="${1%.*}-signed.dmg" echo_step "Creating final read-only ${OUTPUT}" ee hdiutil convert -format UDZO -o "${OUTPUT}" Cutter-rw.dmg + echo_step "Verifying filesystem in ${OUTPUT}" + ee hdiutil attach "${OUTPUT}" -readonly -nobrowse -noautofsck -mountpoint Cutter-rw + trap unmount EXIT + ee diskutil verifyVolume Cutter-rw + unmount + trap - EXIT } case "$1" in