From 3ca274e711dd3115814de160bf93bf51f322371f Mon Sep 17 00:00:00 2001 From: Zorg Date: Thu, 20 Aug 2026 21:33:19 -0700 Subject: [PATCH] Cleanup old availability checks and unused code (#2901) --- Autoupdate/AppInstaller.m | 20 ++++++++------------ Sparkle/SUFileManager.h | 2 +- Tests/SUAppcastTest.swift | 19 ------------------- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/Autoupdate/AppInstaller.m b/Autoupdate/AppInstaller.m index 742c7863..0416eb93 100644 --- a/Autoupdate/AppInstaller.m +++ b/Autoupdate/AppInstaller.m @@ -571,19 +571,15 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; NSURL *downloadDestinationURL = [resolvedCacheInstallationURL URLByAppendingPathComponent:downloadName isDirectory:NO]; BOOL fallbackToFileCopy; - if (@available(macOS 11, *)) { - NSError *renameError = nil; - if (![fileManager renameItemAtResolvedSymlinkURL:resolvedDownloadURL toResolvedSymlinkURL:downloadDestinationURL error:&renameError]) { - SULog(SULogLevelError, @"Error: failed to rename '%@' to '%@'. Falling back to copy operation.", resolvedDownloadURL.path, downloadDestinationURL.path); - - SULogError(renameError); - - fallbackToFileCopy = YES; - } else { - fallbackToFileCopy = NO; - } - } else { + NSError *renameError = nil; + if (![fileManager renameItemAtResolvedSymlinkURL:resolvedDownloadURL toResolvedSymlinkURL:downloadDestinationURL error:&renameError]) { + SULog(SULogLevelError, @"Error: failed to rename '%@' to '%@'. Falling back to copy operation.", resolvedDownloadURL.path, downloadDestinationURL.path); + + SULogError(renameError); + fallbackToFileCopy = YES; + } else { + fallbackToFileCopy = NO; } if (fallbackToFileCopy) { diff --git a/Sparkle/SUFileManager.h b/Sparkle/SUFileManager.h index 83b13f30..652e89ca 100644 --- a/Sparkle/SUFileManager.h +++ b/Sparkle/SUFileManager.h @@ -68,7 +68,7 @@ SUFileManagerDefinitionAttribute * sourceURL and destinationURL must reside on the same volume otherwise this operation will fail. * If any symbolic links are encountered in these paths during path resolution, this operation will fail. */ -- (BOOL)renameItemAtResolvedSymlinkURL:(NSURL *)sourceURL toResolvedSymlinkURL:(NSURL *)destinationURL error:(NSError *__autoreleasing *)error API_AVAILABLE(macosx(11.0)); +- (BOOL)renameItemAtResolvedSymlinkURL:(NSURL *)sourceURL toResolvedSymlinkURL:(NSURL *)destinationURL error:(NSError *__autoreleasing *)error; /** * Returns a URL by resolving links in path. diff --git a/Tests/SUAppcastTest.swift b/Tests/SUAppcastTest.swift index f3c6cf73..cbc9b193 100644 --- a/Tests/SUAppcastTest.swift +++ b/Tests/SUAppcastTest.swift @@ -8,25 +8,6 @@ import XCTest -private let packageInstallationAppcastXML = """ - - - - For unit test only - - Version 2.0 - Sat, 26 Jul 2014 15:20:12 +0000 - - - - Version 1.0 - Sat, 26 Jul 2014 15:20:12 +0000 - - - - -""" - class SUAppcastTest: XCTestCase { func testParseAppcast() {