deal with flakey hdiutil

hdiutil create -format UDBZ -size 640m -srcfolder tmp/build-dmg \
		-volname git-annex -o tmp/git-annex.dmg
hdiutil: create failed - Resource busy

Sometimes it has failed this way for weeks until reboot. Sometimes a single
retry makes it work. Despite many reports of this problem, I have never
found for an explanation for it, other than <shrug> OSX.
This commit is contained in:
Joey Hess 2019-10-17 16:28:48 -04:00
parent 96418dcd11
commit b02bf9f0eb
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -241,8 +241,19 @@ osxapp:
cd $(OSXAPP_DEST) && find . -type f > Contents/MacOS/git-annex.MANIFEST
cd $(OSXAPP_DEST) && find . -type l >> Contents/MacOS/git-annex.MANIFEST
rm -f tmp/git-annex.dmg
hdiutil create -format UDBZ -size 640m -srcfolder tmp/build-dmg \
-volname git-annex -o tmp/git-annex.dmg
# hdiutil sometimes fails with "resource busy", so try a few times
ok=0; for x in 1 2 3 4 5; do \
if [ $$ok = 0 ]; then \
if hdiutil create -format UDBZ -size 640m -srcfolder tmp/build-dmg \
-volname git-annex -o tmp/git-annex.dmg; \
then \
ok=1; \
else \
sleep 60; \
fi \
fi \
done
# Bypass cabal, and only run the main ghc --make command for a
# faster development build.