Skip to content

Commit

Permalink
Make binary delta version 4 the default (#2668)
Browse files Browse the repository at this point in the history
  • Loading branch information
zorgiepoo authored Dec 7, 2024
1 parent 2c95fa4 commit 597825d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Autoupdate/SUBinaryDeltaCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 10 additions & 3 deletions generate_appcast/Appcast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 597825d

Please sign in to comment.