Cleanup old availability checks and unused code (#2901)

This commit is contained in:
Zorg authored and GitHub committed 2026-08-20 21:33:19 -07:00
1 parent b7b02e4929
commit 3ca274e711
3 files changed
+9 -32

No files matched your search

+8 -12
View File
@@ -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) {
+1 -1
View File
@@ -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.
-19
View File
@@ -8,25 +8,6 @@
import XCTest
private let packageInstallationAppcastXML = """
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<title>For unit test only</title>
<item>
<title>Version 2.0</title>
<pubDate>Sat, 26 Jul 2014 15:20:12 +0000</pubDate>
<enclosure url="https://sparkle-project.org/release-2.0.pkg" sparkle:version="2.0" sparkle:installationType="package" length="1346234" />
</item>
<item>
<title>Version 1.0</title>
<pubDate>Sat, 26 Jul 2014 15:20:12 +0000</pubDate>
<enclosure url="https://sparkle-project.org/release-1.0.zip" sparkle:version="1.0" length="1346234" />
</item>
</channel>
</rss>
"""
class SUAppcastTest: XCTestCase {
func testParseAppcast() {