diff --git a/Autoupdate/SUBinaryDeltaApply.m b/Autoupdate/SUBinaryDeltaApply.m index 2f439b09..9a7033f8 100644 --- a/Autoupdate/SUBinaryDeltaApply.m +++ b/Autoupdate/SUBinaryDeltaApply.m @@ -450,10 +450,16 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa fprintf(stderr, "\nApplying file system compression..."); } - NSTask *dittoTask = [[NSTask alloc] init]; + NSMutableArray *dittoArguments = [@[@"--hfsCompression"] mutableCopy]; + if (@available(macOS 27, *)) { + // Compression won't be applied on macOS 27 without passing --noclone + [dittoArguments addObject:@"--noclone"]; + } + [dittoArguments addObjectsFromArray:@[destination, finalDestination]]; + NSTask *dittoTask = [[NSTask alloc] init]; dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO]; - dittoTask.arguments = @[@"--hfsCompression", destination, finalDestination]; + dittoTask.arguments = [dittoArguments copy]; // If we fail to apply file system compression, we will try falling back to not doing this BOOL failedToApplyFileSystemCompression = NO; diff --git a/Tests/SUBinaryDeltaTest.m b/Tests/SUBinaryDeltaTest.m index 7c20d90c..f28f57ac 100644 --- a/Tests/SUBinaryDeltaTest.m +++ b/Tests/SUBinaryDeltaTest.m @@ -1377,7 +1377,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec NSTask *dittoTask = [[NSTask alloc] init]; dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO]; - dittoTask.arguments = @[@"--hfsCompression", destinationFile, destinationFile2]; + dittoTask.arguments = @[@"--hfsCompression", @"--noclone", destinationFile, destinationFile2]; NSError *launchError = nil; BOOL launched = [dittoTask launchAndReturnError:&launchError];