From b64e13c2e2da99952d22d796e52f14d97ba70c33 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Thu, 3 Nov 2022 22:37:29 -0700 Subject: [PATCH] Support space in folder names for build scripts --- src/MacVim/MacVim.xcodeproj/project.pbxproj | 2 +- src/MacVim/scripts/cleanup-after-build | 4 ++-- src/MacVim/scripts/notarize-dmg | 12 +++++------ src/MacVim/scripts/sign-developer-id | 22 ++++++++++----------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj index c5f8e146c9..732c89f3a9 100644 --- a/src/MacVim/MacVim.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj @@ -1053,7 +1053,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "./scripts/cleanup-after-build $BUILT_PRODUCTS_DIR/$WRAPPER_NAME\n"; + shellScript = "./scripts/cleanup-after-build \"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME\"\n"; showEnvVarsInLog = 0; }; 90BD4EF224E0E8B700BF29F2 /* Copy locale message translation files */ = { diff --git a/src/MacVim/scripts/cleanup-after-build b/src/MacVim/scripts/cleanup-after-build index ad6c748f99..b7ed0240ef 100755 --- a/src/MacVim/scripts/cleanup-after-build +++ b/src/MacVim/scripts/cleanup-after-build @@ -13,10 +13,10 @@ macvim_path=$1 sparkle_xpcservices="$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/Current/XPCServices" -if [ -d $sparkle_xpcservices ]; then +if [ -d "$sparkle_xpcservices" ]; then # This only happens when building using Sparkle 2. It contains XPC Services # files which are only necessary for sandboxed apps, and not recommended # otherwise. See https://sparkle-project.org/documentation/sandboxing/. set -x - rm -rf $sparkle_xpcservices + rm -rf "$sparkle_xpcservices" fi diff --git a/src/MacVim/scripts/notarize-dmg b/src/MacVim/scripts/notarize-dmg index 275dedaca2..9d0e171ecf 100755 --- a/src/MacVim/scripts/notarize-dmg +++ b/src/MacVim/scripts/notarize-dmg @@ -11,7 +11,7 @@ fi set -e -macvim_dmg=$1 +macvim_dmg="$1" # Xcode 13 changed the workflow to use "notarytool" instead of "altool". Use that by default. @@ -31,7 +31,7 @@ if [[ "$USE_ALTOOL" != "1" ]]; then fi # Step 1.1: Submit app for notarization, and wait till it finishes. - notarize_submit_results=$(set -x; xcrun notarytool submit ${macvim_dmg} --keychain-profile "${NOTARIZATION_KEYCHAIN_PROFILE}") + notarize_submit_results=$(set -x; xcrun notarytool submit "${macvim_dmg}" --keychain-profile "${NOTARIZATION_KEYCHAIN_PROFILE}") echo $notarize_submit_results notarize_submit_uuid=$(echo $notarize_submit_results | grep "id:" | head -1 | sed -E "s/^.*id:[ ]*(.*)/\1/") @@ -73,7 +73,7 @@ else # Step 1.1: Submit app to Apple's servers for notarization set -x - notarize_submit_uuid=$(xcrun altool --notarize-app --primary-bundle-id "org.vim.macvim" --file ${macvim_dmg} --username "${ALTOOL_USERNAME}" --password "${ALTOOL_PASSWORD}" | grep "RequestUUID" | sed -E "s/RequestUUID = (.*)/\1/") + notarize_submit_uuid=$(xcrun altool --notarize-app --primary-bundle-id "org.vim.macvim" --file "${macvim_dmg}" --username "${ALTOOL_USERNAME}" --password "${ALTOOL_PASSWORD}" | grep "RequestUUID" | sed -E "s/RequestUUID = (.*)/\1/") set +x if [[ ${notarize_submit_uuid} == "" ]]; then @@ -117,10 +117,10 @@ fi # Step 2: Staple the notarization info to the DMG so that an offline user can # verify that it is notarized. -(set -x; xcrun stapler staple ${macvim_dmg}) +(set -x; xcrun stapler staple "${macvim_dmg}") # Just print out extra info for reference echo "--------------------" set -x -codesign -d --verbose=2 ${macvim_dmg} -spctl -a -t open --context context:primary-signature -v ${macvim_dmg} +codesign -d --verbose=2 "${macvim_dmg}" +spctl -a -t open --context context:primary-signature -v "${macvim_dmg}" diff --git a/src/MacVim/scripts/sign-developer-id b/src/MacVim/scripts/sign-developer-id index cd66beeda6..6c8457149a 100755 --- a/src/MacVim/scripts/sign-developer-id +++ b/src/MacVim/scripts/sign-developer-id @@ -17,27 +17,27 @@ set -e macvim_path=$1 entitlements=$2 -if [[ $macvim_path =~ dmg ]]; then +if [[ "$macvim_path" =~ dmg ]]; then set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp $macvim_path + codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path" else # Sign bottom-up to make sure everything is signed in order. # Note: Not using --deep because it's been deprecated since macOS 13, and # also it doesn't catch all the binaries anyway so it's better to just be # explicit and sign everything in order to be clear what we are doing. - if [ -d $macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A ]; then + if [ -d "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A" ]; then (set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp $macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app) + codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app") fi if [ -d $macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B ]; then (set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp $macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate - codesign -f -s "Developer ID Application" -o runtime --timestamp $macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app) + codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate" + codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app") fi set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp $macvim_path/Contents/Frameworks/Sparkle.framework - codesign -f -s "Developer ID Application" -o runtime --timestamp $macvim_path/Contents/Frameworks/PSMTabBarControl.framework - codesign -f -s "Developer ID Application" -o runtime --timestamp $macvim_path/Contents/Library/QuickLook/QLStephen.qlgenerator/Contents/MacOS/QLStephen - codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements $macvim_path/Contents/MacOS/Vim - codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements $macvim_path + codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework" + codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/PSMTabBarControl.framework" + codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Library/QuickLook/QLStephen.qlgenerator/Contents/MacOS/QLStephen" + codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements "$macvim_path/Contents/MacOS/Vim" + codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements "$macvim_path" fi