From 8fa2f51b9154a708a64caab4d0d52d12c8c47246 Mon Sep 17 00:00:00 2001 From: Brentley Jones Date: Fri, 18 Apr 2025 09:20:29 -0500 Subject: [PATCH] Limit `rsync` bug check to macOS 15.4.0 `rsync` bug was fixed in macOS 15.4.1 and macOS 15.5.0 beta 2. Signed-off-by: Brentley Jones --- xcodeproj/internal/bazel_integration_files/copy_dsyms.sh | 8 ++++---- .../internal/bazel_integration_files/copy_outputs.sh | 6 +++--- xcodeproj/internal/templates/incremental_installer.sh | 6 +++--- xcodeproj/internal/templates/legacy_installer.sh | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/xcodeproj/internal/bazel_integration_files/copy_dsyms.sh b/xcodeproj/internal/bazel_integration_files/copy_dsyms.sh index f66067413..1294c93d4 100644 --- a/xcodeproj/internal/bazel_integration_files/copy_dsyms.sh +++ b/xcodeproj/internal/bazel_integration_files/copy_dsyms.sh @@ -49,10 +49,10 @@ EOF if [[ -n "${BAZEL_OUTPUTS_DSYM:-}" ]]; then cd "${BAZEL_OUT%/*}" - if (( $(echo "$(sw_vers -productVersion | cut -d '.' -f 1-2)" | sed 's/\.//g') >= 154 )); then - # 15.4's `rsync` has a bug that requires the src to have write permissions. - # We normally shouldn't do this as it modifies the bazel output base, so we - # limit this to only macOS 15.4 or higher. + if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then + # 15.4.0's `rsync` has a bug that requires the src to have write + # permissions. We normally shouldn't do this as it modifies the bazel output + # base, so we limit this to only macOS 15.4.0. # shellcheck disable=SC2046 chmod -R +w $(xargs -n1 <<< "$BAZEL_OUTPUTS_DSYM") fi diff --git a/xcodeproj/internal/bazel_integration_files/copy_outputs.sh b/xcodeproj/internal/bazel_integration_files/copy_outputs.sh index 7c0233bf8..c49114338 100755 --- a/xcodeproj/internal/bazel_integration_files/copy_outputs.sh +++ b/xcodeproj/internal/bazel_integration_files/copy_outputs.sh @@ -30,10 +30,10 @@ if [[ "$ACTION" != indexbuild ]]; then # rpaths to work ln -sfh "$PWD/$BAZEL_OUTPUTS_PRODUCT_BASENAME" "$TARGET_BUILD_DIR/$PRODUCT_NAME" else - if (( $(echo "$(sw_vers -productVersion | cut -d '.' -f 1-2)" | sed 's/\.//g') >= 154 )); then - # 15.4's `rsync` has a bug that requires the src to have write + if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then + # 15.4.0's `rsync` has a bug that requires the src to have write # permissions. We normally shouldn't do this as it modifies the bazel - # output base, so we limit this to only macOS 15.4 or higher. + # output base, so we limit this to only macOS 15.4.0. chmod -R +w "$BAZEL_OUTPUTS_PRODUCT_BASENAME" fi diff --git a/xcodeproj/internal/templates/incremental_installer.sh b/xcodeproj/internal/templates/incremental_installer.sh index e1adaa161..e880b1e44 100644 --- a/xcodeproj/internal/templates/incremental_installer.sh +++ b/xcodeproj/internal/templates/incremental_installer.sh @@ -74,10 +74,10 @@ dest_dir="$(dirname "${dest}")" # Copy over `xcschemes` readonly dest_xcschemes="$dest/xcshareddata/xcschemes" -if (( $(echo "$(sw_vers -productVersion | cut -d '.' -f 1-2)" | sed 's/\.//g') >= 154 )); then - # 15.4's `rsync` has a bug that requires the src to have write permissions. +if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then + # 15.4.0's `rsync` has a bug that requires the src to have write permissions. # We normally shouldn't do this as it modifies the bazel output base, so we - # limit this to only macOS 15.4 or higher. + # limit this to only macOS 15.4.0. chmod -R +w "$src_xcschemes" fi diff --git a/xcodeproj/internal/templates/legacy_installer.sh b/xcodeproj/internal/templates/legacy_installer.sh index f24cf3b76..4984e94fe 100644 --- a/xcodeproj/internal/templates/legacy_installer.sh +++ b/xcodeproj/internal/templates/legacy_installer.sh @@ -136,10 +136,10 @@ fi # Sync over the project, changing the permissions to be writable -if (( $(echo "$(sw_vers -productVersion | cut -d '.' -f 1-2)" | sed 's/\.//g') >= 154 )); then - # 15.4's `rsync` has a bug that requires the src to have write permissions. +if [[ "$(sw_vers -productVersion)" == "15.4.0" ]]; then + # 15.4.0's `rsync` has a bug that requires the src to have write permissions. # We normally shouldn't do this as it modifies the bazel output base, so we - # limit this to only macOS 15.4 or higher. + # limit this to only macOS 15.4.0. chmod -R +w "$src" fi