From 597825d111b56cb727c814f338339c58e33a2957 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 7 Dec 2024 14:46:23 -0800 Subject: [PATCH] Make binary delta version 4 the default (#2668) --- Autoupdate/SUBinaryDeltaCommon.m | 2 +- generate_appcast/Appcast.swift | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Autoupdate/SUBinaryDeltaCommon.m b/Autoupdate/SUBinaryDeltaCommon.m index 90e5d50da7..40bea730c2 100644 --- a/Autoupdate/SUBinaryDeltaCommon.m +++ b/Autoupdate/SUBinaryDeltaCommon.m @@ -22,7 +22,7 @@ // Note: the framework bundle version must be bumped, and generate_appcast must be updated to compare it, // when we add/change new major versions and defaults. Unit tests need to be updated to use new versions too. -SUBinaryDeltaMajorVersion SUBinaryDeltaMajorVersionDefault = SUBinaryDeltaMajorVersion3; +SUBinaryDeltaMajorVersion SUBinaryDeltaMajorVersionDefault = SUBinaryDeltaMajorVersion4; SUBinaryDeltaMajorVersion SUBinaryDeltaMajorVersionLatest = SUBinaryDeltaMajorVersion4; SUBinaryDeltaMajorVersion SUBinaryDeltaMajorVersionFirst = SUBinaryDeltaMajorVersion1; SUBinaryDeltaMajorVersion SUBinaryDeltaMajorVersionFirstSupported = SUBinaryDeltaMajorVersion2; diff --git a/generate_appcast/Appcast.swift b/generate_appcast/Appcast.swift index 0822aa7a88..b135570f8e 100644 --- a/generate_appcast/Appcast.swift +++ b/generate_appcast/Appcast.swift @@ -283,13 +283,20 @@ func makeAppcasts(archivesSourceDir: URL, outputPathURL: URL?, cacheDirectory ca // Decide the most appropriate delta version let deltaVersion: SUBinaryDeltaMajorVersion if let frameworkVersion = item.frameworkVersion { - switch standardComparator.compareVersion(frameworkVersion, toVersion: "2010") { + switch standardComparator.compareVersion(frameworkVersion, toVersion: "2041") { case .orderedSame: fallthrough case .orderedDescending: - deltaVersion = .version3 + deltaVersion = .version4 case .orderedAscending: - deltaVersion = .version2 + switch standardComparator.compareVersion(frameworkVersion, toVersion: "2010") { + case .orderedSame: + fallthrough + case .orderedDescending: + deltaVersion = .version3 + case .orderedAscending: + deltaVersion = .version2 + } } } else { deltaVersion = SUBinaryDeltaMajorVersionDefault