From 97c6331b5f47f66e87cd85fabe20cb17f89ba190 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Thu, 6 Apr 2023 21:16:41 +0700 Subject: [PATCH] fix(mac): fix corrupt installer Fixes #8533 after build agent maintenance put GNU coreutils cp on path ahead of macOS /bin/cp. This subtly changed the behaviour of the `-R` flag such that it copied the folder into a subfolder rather than copying the contents of the folder into the destination folder: Original layout: ``` Install Keyman.app/Contents/MacOS/ applet textinputsource Keyman.app/ ``` Corrupted layout: ``` Install Keyman.app/Install Keyman.app/Contents/MacOS/ applet textinputsource Keyman.app/ ``` Query: should we be rolling back the path changes so that /bin is first on the path? I am concerned about other subtle changes in behaviour in the macOS and iOS builds. Otherwise it feels like we may need to audit the scripts in /mac, /ios (and possibly /common, /core, /web, /resources) for potential changes. Annoyed that it took me so long. Also annoying that macOS fails so subtly when a parent folder has the .app extension in its name. --- mac/Keyman4MacIM/make-km-dmg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac/Keyman4MacIM/make-km-dmg.sh b/mac/Keyman4MacIM/make-km-dmg.sh index 645abb72ed..062c82c527 100755 --- a/mac/Keyman4MacIM/make-km-dmg.sh +++ b/mac/Keyman4MacIM/make-km-dmg.sh @@ -174,7 +174,7 @@ displayInfo "Copying files from \"$SOURCE_KM_APP\"..." find "$DEST_KM_APP" -mindepth 1 -maxdepth 1 echo "---------" find "$DEST_KM_APP" -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf -cp -fR "$SOURCE_KM_APP/" "$DEST_KM_APP" +cp -fR "$SOURCE_KM_APP/"* "$DEST_KM_APP/" echo "---- Listing info in /Volumes/Keyman/ ----" echo "DEST_KM_APP=$DEST_KM_APP"