diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-01-12 01:40:37 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-16 09:08:14 +0000 |
commit | c538808b29575995f4fab45a5b7dbb56ce54f4aa (patch) | |
tree | e09760bd9982bfed7dbb7a05cdeeb75dd7f8ab6e | |
parent | f6b6feb435ac5420559f8dd6cbb09421ba90e5a7 (diff) |
Always exit with error if codesign fails
That sanity check was added in
615fae2f67028f3c5c51c70c77dbaa9b9f3856d6 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
(cherry picked from commit a6216119be2c32e9031c6bb9b7dfa07f0468d813)
Reviewed-on: https://gerrit.libreoffice.org/33071
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rwxr-xr-x | solenv/bin/macosx-codesign-app-bundle | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/solenv/bin/macosx-codesign-app-bundle b/solenv/bin/macosx-codesign-app-bundle index 179ef5c518a1..a05bf0577531 100755 --- a/solenv/bin/macosx-codesign-app-bundle +++ b/solenv/bin/macosx-codesign-app-bundle @@ -63,7 +63,7 @@ done find "$APP_BUNDLE/Contents/MacOS" -type f | while read file; do 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 # Sign included bundles. First .app ones (i.e. the Python.app inside @@ -75,7 +75,7 @@ while read app; do fn=${fn%.*} # 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>.*,,'` - codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$app" + codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$app" || exit 1 done # Then .framework ones. Again, be generic just for kicks. @@ -88,7 +88,7 @@ while read framework; do if test ! -L "$version" -a -d "$version"; then # 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>.*,,'` - codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$version" + codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$version" || exit 1 fi done done @@ -97,7 +97,7 @@ done find "$APP_BUNDLE" -name '*.mdimporter' -type d | 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 # Sign the app bundle as a whole which means (re-)signing the @@ -114,6 +114,6 @@ done 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 |