summaryrefslogtreecommitdiff
path: root/tools/osx_packaging
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-01-12 18:57:02 +0100
committerRobin Gareus <robin@gareus.org>2015-01-12 18:57:02 +0100
commitf1b5f90a3e723075b0dc32bbd7fb240895324063 (patch)
tree55384fe4f5b0d6acc723dbdf7bba7709d4b9f02f /tools/osx_packaging
parente90a784fb50ed7871a24f972265d52f0f21d07a7 (diff)
strict OSX packaging, fail on error
Diffstat (limited to 'tools/osx_packaging')
-rwxr-xr-xtools/osx_packaging/osx_build12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/osx_packaging/osx_build b/tools/osx_packaging/osx_build
index 81892ccc46..dc959b5020 100755
--- a/tools/osx_packaging/osx_build
+++ b/tools/osx_packaging/osx_build
@@ -1,5 +1,7 @@
#!/bin/bash
+set -e
+
# script for pulling together a MacOSX app bundle.
GTKSTACK_ROOT=$HOME/gtk/inst
@@ -231,6 +233,8 @@ else
fi
cp typeArdour.icns $Resources/
+set +e # things below are not error-free (optional files etc) :(
+
# copy locale files
if test x$WITH_NLS != x ; then
echo "NLS support ..."
@@ -607,8 +611,6 @@ else
fi
VOLNAME=$APPNAME-$release_version
-# TODO use mktemp
-export TMPDIR=`pwd`
MNTPATH=`mktemp -d -t ardourimg`
TMPDMG=`mktemp -t ardour`
ICNSTMP=`mktemp -t ardouricon`
@@ -623,6 +625,8 @@ mkdir -p "$MNTPATH"
TMPDMG="${TMPDMG}.dmg"
+trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
+
hdiutil create -megabytes $DMGMEGABYTES "$TMPDMG"
DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
newfs_hfs -v "${VOLNAME}" "${DiskDevice}"
@@ -673,6 +677,7 @@ EOF
chmod -Rf go-w "${MNTPATH}"
sync
+set -e
echo "compressing Image ..."
# Umount the image
@@ -680,9 +685,6 @@ umount "${DiskDevice}"
hdiutil eject "${DiskDevice}"
# Create a read-only version, use zlib compression
hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
-# Delete the temporary files
-rm "$TMPDMG"
-rm -rf "$MNTPATH"
echo "setting file icon ..."