Kaydet (Commit) a6216119 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Always exit with error if codesign fails

That sanity check was added in
615fae2f but we lost it at some stage.

The codesigning script has a very confusing history, in part caused by
its use for two purposes, when building for the Mac App Store and when
building for a TDF style distribution on a dmg disk image. Those who
work with the former and those who work with the latter haven't
necessarily checked that it doesn't break for the other case. Sorry.

Change-Id: I79011302f60b1f6551328c8b80e00f5d3698504c
üst 3e7e4df5
...@@ -55,7 +55,7 @@ done ...@@ -55,7 +55,7 @@ done
find "$APP_BUNDLE/Contents/MacOS" -type f | find "$APP_BUNDLE/Contents/MacOS" -type f |
while read file; do while read file; do
id=`echo ${file#${APP_BUNDLE}/Contents/} | sed -e 's,/,.,g'` id=`echo ${file#${APP_BUNDLE}/Contents/} | sed -e 's,/,.,g'`
codesign --force --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$file" codesign --force --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$file" || exit 1
done done
# Sign included bundles. First .app ones (i.e. the Python.app inside # Sign included bundles. First .app ones (i.e. the Python.app inside
...@@ -67,7 +67,7 @@ while read app; do ...@@ -67,7 +67,7 @@ while read app; do
fn=${fn%.*} fn=${fn%.*}
# Assume the app has a XML (and not binary) Info.plist # Assume the app has a XML (and not binary) Info.plist
id=`grep -A 1 '<key>CFBundleIdentifier</key>' $app/Contents/Info.plist | tail -1 | sed -e 's,.*<string>,,' -e 's,</string>.*,,'` id=`grep -A 1 '<key>CFBundleIdentifier</key>' $app/Contents/Info.plist | tail -1 | sed -e 's,.*<string>,,' -e 's,</string>.*,,'`
codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$app" codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$app" || exit 1
done done
# Then .framework ones. Again, be generic just for kicks. # Then .framework ones. Again, be generic just for kicks.
...@@ -80,7 +80,7 @@ while read framework; do ...@@ -80,7 +80,7 @@ while read framework; do
if test ! -L "$version" -a -d "$version"; then if test ! -L "$version" -a -d "$version"; then
# Assume the framework has a XML (and not binary) Info.plist # Assume the framework has a XML (and not binary) Info.plist
id=`grep -A 1 '<key>CFBundleIdentifier</key>' $version/Resources/Info.plist | tail -1 | sed -e 's,.*<string>,,' -e 's,</string>.*,,'` id=`grep -A 1 '<key>CFBundleIdentifier</key>' $version/Resources/Info.plist | tail -1 | sed -e 's,.*<string>,,' -e 's,</string>.*,,'`
codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$version" codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$version" || exit 1
fi fi
done done
done done
...@@ -89,7 +89,7 @@ done ...@@ -89,7 +89,7 @@ done
find "$APP_BUNDLE" -name '*.mdimporter' -type d | find "$APP_BUNDLE" -name '*.mdimporter' -type d |
while read bundle; do while read bundle; do
codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" "$bundle" codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" "$bundle" || exit 1
done done
# Sign the app bundle as a whole which means (re-)signing the # Sign the app bundle as a whole which means (re-)signing the
...@@ -106,6 +106,6 @@ done ...@@ -106,6 +106,6 @@ done
id=`echo ${PRODUCTNAME} | tr ' ' '-'` id=`echo ${PRODUCTNAME} | tr ' ' '-'`
codesign --force --verbose --identifier="${MACOSX_BUNDLE_IDENTIFIER}" --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$APP_BUNDLE" codesign --force --verbose --identifier="${MACOSX_BUNDLE_IDENTIFIER}" --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$APP_BUNDLE" || exit 1
exit 0 exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment