Skip to content

Commit

Permalink
strict OSX packaging, fail on error
Browse files Browse the repository at this point in the history
  • Loading branch information
x42 committed Jan 12, 2015
1 parent e90a784 commit f1b5f90
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/osx_packaging/osx_build
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

# script for pulling together a MacOSX app bundle.

GTKSTACK_ROOT=$HOME/gtk/inst
Expand Down Expand Up @@ -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 ..."
Expand Down Expand Up @@ -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`
Expand All @@ -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}"
Expand Down Expand Up @@ -673,16 +677,14 @@ EOF
chmod -Rf go-w "${MNTPATH}"
sync

set -e
echo "compressing Image ..."

# Umount the image
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 ..."

Expand Down

0 comments on commit f1b5f90

Please sign in to comment.