[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - solenv/bin

Tor Lillqvist tml at collabora.com
Wed Feb 22 18:27:38 UTC 2017


 solenv/bin/macosx-codesign-app-bundle |   31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

New commits:
commit 977e439e4d2ae4c95a6a8d948a98267941628a59
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Feb 22 12:57:46 2017 +0200

    Improve error handling and fix some problems
    
    Use the -e and -o pipefail bash option to make the script fail more
    reliably if some command inside a pipeline fails. Use the -u option to
    catch mistyped variable names.
    
    Move the signing of executables in the bundle's Contents/MacOS after
    signing bundled frameworks.
    
    (cherry picked from commit b06edd5a07f18b0999adc0084b8133eb6481f867)
    
    Change-Id: I21d441bcb2dbfc19b0cb5718b76402b1686d2239
    Reviewed-on: https://gerrit.libreoffice.org/34549
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/solenv/bin/macosx-codesign-app-bundle b/solenv/bin/macosx-codesign-app-bundle
index a05bf05..1149e70 100755
--- a/solenv/bin/macosx-codesign-app-bundle
+++ b/solenv/bin/macosx-codesign-app-bundle
@@ -1,5 +1,12 @@
 #!/bin/bash
 
+# Exit on errors
+set -e
+# Use of unset variable is an error
+set -u
+# If any part of a pipeline of commands fails, the whole pipeline fails
+set -o pipefail
+
 # Script to sign executables, dylibs and frameworks in an app bundle
 # plus the bundle itself. Called from
 # the test-install target in Makefile.in
@@ -58,18 +65,10 @@ while read file; do
     codesign --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$file" || exit 1
 done
 
-# Sign executables
-
-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" || exit 1
-done
-
 # Sign included bundles. First .app ones (i.e. the Python.app inside
 # the LibreOfficePython.framework. Be generic for kicks...)
 
-find "$APP_BUNDLE" -name '*.app' -type d |
+find "$APP_BUNDLE"/Contents -name '*.app' -type d |
 while read app; do
     fn=`basename "$app"`
     fn=${fn%.*}
@@ -100,6 +99,20 @@ while read bundle; do
     codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" "$bundle" || exit 1
 done
 
+# Sign executables
+
+find "$APP_BUNDLE/Contents/MacOS" -type f |
+while read file; do
+    case "$file" in
+	*/soffice)
+	    ;;
+	*)
+	    id=`echo ${file#${APP_BUNDLE}/Contents/} | sed -e 's,/,.,g'`
+	    codesign --force --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$file" || exit 1
+	    ;;
+    esac
+done
+
 # Sign the app bundle as a whole which means (re-)signing the
 # CFBundleExecutable from Info.plist, i.e. soffice, plus the contents
 # of the Resources tree (which unless you used


More information about the Libreoffice-commits mailing list