Compare commits

..
Author SHA1 Message Date
Zorg 5173763c07 Test compiler warning 2023-10-15 19:57:11 -07:00
Jozef Izso 5a8f25faed Update mshick/add-pr-comment
The v2 action uses `node16` runtime
Workflow will use the `GITHUB_TOKEN` with `pull-requests: write` permission instead of PAT
2023-10-13 22:48:33 +02:00
Jozef Izso d1175e4dd9 Update actions/checkout and actions/upload-artifact
This removes the warning about the deprecated `node12` runtime used by existing actions.
2023-10-13 21:12:41 +02:00
Zorg bd90fb7b18 Filter for archive files in generate_appcast more intelligently (#2448) 2023-10-08 09:38:50 -07:00
floorish 9684a433ee Use correct entitlements and dsym files when using custom bundle id and XPC names in ConfigCommon (#2446) 2023-09-30 10:39:16 -07:00
Zorg ff4d4f53a8 Bring back specifying version in issue template 2023-09-30 08:13:44 -07:00
Zorg 469f423e28 Fix test cases for localized release notes (#2444) 2023-09-28 22:52:32 -07:00
Zorg 846838c90b Update issue templates (#2443) 2023-09-28 21:06:23 -07:00
Zorg f6a86f52b3 Default to English for XML nodes when no xml:lang is present (#2440)
This only applies when multiple XML nodes are present with the same name. E.g. multiple description or releaseNoteLink elements with different xml:lang's specified.

Also generate a warning if an language has to be interpreted implicitly when there is no xml:lang explicitly specified and there are multiple node items.
2023-09-28 20:02:29 -07:00
Sparkle-Bot f0ceaf5cc9 Update Package management files for version 2.5.0 2023-09-15 23:55:58 +00:00
Zorg 569f69b463 Update CHANGELOG 2023-09-15 16:48:38 -07:00
Zorg 7cc751ff4f Fail gracefully when auxiliary tool cannot be located (#2436) 2023-09-06 21:05:59 -07:00
20 changed files with 190 additions and 141 deletions

No files matched your search

@@ -29,4 +29,4 @@ https://github.com/sparkle-project/Sparkle#troubleshooting
## Version ## Version
[please specify versions of Sparkle this is applicable to; note the old 1.x (master) branch is only taking fixes to regressions and security fixes now.] [please specify versions of Sparkle this is applicable to]
@@ -1,36 +0,0 @@
---
name: Sparkle 1.x doesn't work in my app
about: Problems with integration, unexpected errors using Sparkle 1
title: ''
labels: '1.x'
assignees: ''
---
<!--
The answer to your issue is probably already in Console.app on your computer.
Please use Console.app and search for Sparkle.
Please try troubleshooting steps:
https://github.com/sparkle-project/Sparkle#troubleshooting
-->
### Description of the problem
### Do you use Sandboxing in your app?
### Version of `Sparkle.framework` in the latest version of your app
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
### Sparkle's output from Console.app
```
```
### Steps to reproduce the behavior
[The more information provided and pasted verbatim, the easier it will be to diagnose an issue. If you can provide the affected application/binary and XML feed to reproduce an issue, share them]
@@ -1,8 +1,7 @@
--- ---
name: Sparkle 2.x doesn't work in my app name: Sparkle doesn't work in my app
about: Problems with integration, unexpected errors using Sparkle 2 about: Problems with integration, unexpected errors using Sparkle
title: '' title: ''
labels: '2.x'
assignees: '' assignees: ''
--- ---
-2
View File
@@ -7,8 +7,6 @@ Fixes # (issue)
- [ ] My change requires a documentation update on [Sparkle's website repository](https://github.com/sparkle-project/sparkle-project.github.io) - [ ] My change requires a documentation update on [Sparkle's website repository](https://github.com/sparkle-project/sparkle-project.github.io)
- [ ] My change requires changes to generate_appcast, generate_keys, or sign_update - [ ] My change requires changes to generate_appcast, generate_keys, or sign_update
Only bug fixes to regressions or security fixes are being backported to the 1.x (master) branch now. If you believe your change is significant enough to backport, please also create a separate pull request against the master branch.
## Testing ## Testing
I tested and verified my change by using one or multiple of these methods: I tested and verified my change by using one or multiple of these methods:
+7 -6
View File
@@ -26,9 +26,12 @@ jobs:
name: Build and Test Sparkle name: Build and Test Sparkle
runs-on: ${{ matrix.macos }} runs-on: ${{ matrix.macos }}
permissions:
pull-requests: write
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0
@@ -80,11 +83,9 @@ jobs:
- name: Post Analyzed Warnings - name: Post Analyzed Warnings
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }} if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }}
uses: mshick/add-pr-comment@v1 uses: mshick/add-pr-comment@v2
with: with:
allow-repeats: false allow-repeats: false
repo-token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
repo-token-user-login: 'Sparkle-Bot'
message: "``` ${{ steps.warnings.outputs.content }} ```" message: "``` ${{ steps.warnings.outputs.content }} ```"
- name: Build Release Distribution - name: Build Release Distribution
@@ -94,13 +95,13 @@ jobs:
xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build
- name: Archive Test Results - name: Archive Test Results
if: failure() if: failure()
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: build-logs name: build-logs
path: build/Logs path: build/Logs
- name: Upload Distribution - name: Upload Distribution
if: ${{ success() && matrix.upload-dist }} if: ${{ success() && matrix.upload-dist }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: Sparkle-distribution-${{ matrix.xcode }}.tar.xz name: Sparkle-distribution-${{ matrix.xcode }}.tar.xz
path: build/Build/Products/Release/sparkle-dist.tar.xz path: build/Build/Products/Release/sparkle-dist.tar.xz
+1
View File
@@ -25,6 +25,7 @@ static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPa
NSArray <NSString *> *extractTBZ = @[@"/usr/bin/tar", @"-jxC"]; NSArray <NSString *> *extractTBZ = @[@"/usr/bin/tar", @"-jxC"];
NSArray <NSString *> *extractTXZ = extractTGZ; NSArray <NSString *> *extractTXZ = extractTGZ;
// Note: keep this list in sync with generate_appcast's unarchiveUpdates()
NSDictionary <NSString *, NSArray<NSString *> *> *extractCommandDictionary = NSDictionary <NSString *, NSArray<NSString *> *> *extractCommandDictionary =
@{ @{
@".zip" : @[@"/usr/bin/ditto", @"-x",@"-k",@"-"], @".zip" : @[@"/usr/bin/ditto", @"-x",@"-k",@"-"],
+37 -58
View File
@@ -41,7 +41,7 @@
return self; return self;
} }
- (void)_performInitialInstallationWithFileManager:(SUFileManager *)fileManager oldBundleURL:(NSURL *)oldBundleURL newBundleURL:(NSURL *)newBundleURL gatekeeperScan:(BOOL)gatekeeperScan progressBlock:(nullable void(^)(double))progress SPU_OBJC_DIRECT - (void)_performInitialInstallationWithFileManager:(SUFileManager *)fileManager oldBundleURL:(NSURL *)oldBundleURL newBundleURL:(NSURL *)newBundleURL progressBlock:(nullable void(^)(double))progress SPU_OBJC_DIRECT
{ {
// Release our new app from quarantine // Release our new app from quarantine
NSError *quarantineError = nil; NSError *quarantineError = nil;
@@ -88,34 +88,6 @@
if (progress) { if (progress) {
progress(8/11.0); progress(8/11.0);
} }
if (gatekeeperScan) {
// Perform a Gatekeeper scan so users do not see the 'Verifying...' dialog when the update is launched
if (@available(macOS 14, *)) {
NSURL *gktoolURL = [NSURL fileURLWithPath:@"/usr/bin/gktool" isDirectory:NO];
if ([gktoolURL checkResourceIsReachableAndReturnError:NULL]) {
NSString *newBundlePath = newBundleURL.path;
assert(newBundlePath != nil);
NSTask *gatekeeperScanTask = [[NSTask alloc] init];
gatekeeperScanTask.executableURL = gktoolURL;
gatekeeperScanTask.arguments = @[@"scan", newBundlePath];
NSError *taskError;
if (![gatekeeperScanTask launchAndReturnError:&taskError]) {
// Not a fatal error
SULog(SULogLevelError, @"Failed to perform GateKeeper scan on '%@' with error %@", newBundlePath, taskError);
} else {
[gatekeeperScanTask waitUntilExit];
int terminationStatus = gatekeeperScanTask.terminationStatus;
if (terminationStatus != 0) {
// Not a fatal error
SULog(SULogLevelError, @"gktool returned error status %d for GateKeeper scan on '%@'", terminationStatus, newBundlePath);
}
}
}
}
}
} }
@@ -171,38 +143,45 @@
progress(2/11.0); progress(2/11.0);
} }
// Create a temporary directory for our new app that resides on our destination's volume NSURL *tempNewDirectoryURL;
// We use oldURL here instead of installationURL because in the case of normalization, installationURL may not exist if (!_newAndOldBundlesOnSameVolume) {
// And we don't want to use either of the URL's parent directories because the parent directory could be on a different volume // Create a temporary directory for our new app that resides on our destination's volume
// Note it is still important to use a temporary directory for the new update even if the bundles are on the same volume // We use oldURL here instead of installationURL because in the case of normalization, installationURL may not exist
// Swapping the bundles when the new bundle is not in a temporary directory created for installation can cause problems. // And we don't want to use either of the URL's parent directories because the parent directory could be on a different volume
// For example, if we didn't do this, atomically swapping app bundles may fail after performing a Gatekeeper scan tempNewDirectoryURL = [fileManager makeTemporaryDirectoryAppropriateForDirectoryURL:oldURL error:error];
NSURL *tempNewDirectoryURL = [fileManager makeTemporaryDirectoryAppropriateForDirectoryURL:oldURL error:error]; if (tempNewDirectoryURL == nil) {
if (tempNewDirectoryURL == nil) { return NO;
return NO; }
_temporaryNewDirectory = tempNewDirectoryURL;
} else {
tempNewDirectoryURL = nil;
} }
_temporaryNewDirectory = tempNewDirectoryURL;
if (progress) { if (progress) {
progress(3/11.0); progress(3/11.0);
} }
// Move the new app to our temporary directory // Move the new app to our temporary directory if needed
NSString *newURLLastPathComponent = newURL.lastPathComponent; NSURL *newFinalURL;
NSURL *newTempURL = [tempNewDirectoryURL URLByAppendingPathComponent:newURLLastPathComponent]; if (!_newAndOldBundlesOnSameVolume) {
NSError *newTempMoveError = nil; NSString *newURLLastPathComponent = newURL.lastPathComponent;
if (![fileManager moveItemAtURL:newURL toURL:newTempURL error:&newTempMoveError]) { newFinalURL = [tempNewDirectoryURL URLByAppendingPathComponent:newURLLastPathComponent];
if (error != NULL) { NSError *newTempMoveError = nil;
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to move the new app from %@ to its temp directory at %@", newURL.path, newTempURL.path] }]; if (![fileManager moveItemAtURL:newURL toURL:newFinalURL error:&newTempMoveError]) {
if (error != NULL) {
if (newTempMoveError != nil) { NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to move the new app from %@ to its temp directory at %@", newURL.path, newFinalURL.path] }];
userInfo[NSUnderlyingErrorKey] = newTempMoveError;
if (newTempMoveError != nil) {
userInfo[NSUnderlyingErrorKey] = newTempMoveError;
}
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:userInfo];
} }
return NO;
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:userInfo];
} }
return NO; } else {
newFinalURL = newURL;
} }
if (progress) { if (progress) {
@@ -210,7 +189,7 @@
} }
if (!_newAndOldBundlesOnSameVolume) { if (!_newAndOldBundlesOnSameVolume) {
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:oldURL newBundleURL:newTempURL gatekeeperScan:NO progressBlock:progress]; [self _performInitialInstallationWithFileManager:fileManager oldBundleURL:oldURL newBundleURL:newFinalURL progressBlock:progress];
} }
if (progress) { if (progress) {
@@ -226,7 +205,7 @@
} else { } else {
// We will be cleaning up the temporary directory later in -performCleanup: // We will be cleaning up the temporary directory later in -performCleanup:
// We don't want to clean it up now because it can take some time // We don't want to clean it up now because it can take some time
swappedApp = [fileManager swapItemAtURL:installationURL withItemAtURL:newTempURL error:&swapError]; swappedApp = [fileManager swapItemAtURL:installationURL withItemAtURL:newFinalURL error:&swapError];
} }
if (!swappedApp) { if (!swappedApp) {
@@ -280,9 +259,9 @@
// Move the new app to its final destination // Move the new app to its final destination
NSError *installMoveError = nil; NSError *installMoveError = nil;
if (![fileManager moveItemAtURL:newTempURL toURL:installationURL error:&installMoveError]) { if (![fileManager moveItemAtURL:newFinalURL toURL:installationURL error:&installMoveError]) {
if (error != NULL) { if (error != NULL) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to move new app at %@ to final destination %@", newTempURL.path, installationURL.path] }]; NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to move new app at %@ to final destination %@", newFinalURL.path, installationURL.path] }];
if (installMoveError != nil) { if (installMoveError != nil) {
userInfo[NSUnderlyingErrorKey] = installMoveError; userInfo[NSUnderlyingErrorKey] = installMoveError;
@@ -333,7 +312,7 @@
// We can do a lot of the installation work ahead of time if the new app update does not need to be copied to another volume // We can do a lot of the installation work ahead of time if the new app update does not need to be copied to another volume
if (_newAndOldBundlesOnSameVolume) { if (_newAndOldBundlesOnSameVolume) {
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:_host.bundle.bundleURL newBundleURL:bundle.bundleURL gatekeeperScan:YES progressBlock:NULL]; [self _performInitialInstallationWithFileManager:fileManager oldBundleURL:_host.bundle.bundleURL newBundleURL:bundle.bundleURL progressBlock:NULL];
} }
return YES; return YES;
+1
View File
@@ -12,6 +12,7 @@
* Replace CFUUID* with NSUUID (#2395) (Eitot) * Replace CFUUID* with NSUUID (#2395) (Eitot)
* Report an error when detecting duplicate updates in generate_appcast (#2407) (Zorg) * Report an error when detecting duplicate updates in generate_appcast (#2407) (Zorg)
* Improve error for rejecting xattr based code signing for delta updates (#2408) (Zorg) * Improve error for rejecting xattr based code signing for delta updates (#2408) (Zorg)
* Fail gracefully when auxiliary tool cannot be located (#2436) (Zorg)
# 2.4.2 # 2.4.2
+1 -1
View File
@@ -1 +1 @@
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz"} {"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz"}
+2 -2
View File
@@ -96,8 +96,8 @@ SPARKLE_VERSION_PATCH = 0
// This should be in SemVer format or empty, ie. "-beta.1" // This should be in SemVer format or empty, ie. "-beta.1"
// These variables must have a space after the '=' too // These variables must have a space after the '=' too
SPARKLE_VERSION_SUFFIX = -beta.2 SPARKLE_VERSION_SUFFIX =
CURRENT_PROJECT_VERSION = 2030 CURRENT_PROJECT_VERSION = 2031
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX) MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
ALWAYS_SEARCH_USER_PATHS = NO ALWAYS_SEARCH_USER_PATHS = NO
+1 -1
View File
@@ -4,6 +4,6 @@ INFOPLIST_FILE = Downloader/Info.plist
WRAPPER_EXTENSION = xpc WRAPPER_EXTENSION = xpc
PRODUCT_BUNDLE_IDENTIFIER = ${DOWNLOADER_BUNDLE_ID} PRODUCT_BUNDLE_IDENTIFIER = ${DOWNLOADER_BUNDLE_ID}
PRODUCT_NAME = ${DOWNLOADER_NAME} PRODUCT_NAME = ${DOWNLOADER_NAME}
CODE_SIGN_ENTITLEMENTS = Downloader/${DOWNLOADER_BUNDLE_ID}.entitlements CODE_SIGN_ENTITLEMENTS = Downloader/org.sparkle-project.Downloader.entitlements
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_SOURCES_EXTERNALLY=1 GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
CLANG_MODULES_AUTOLINK = NO CLANG_MODULES_AUTOLINK = NO
+1 -1
View File
@@ -7,7 +7,7 @@ rm -rd "$BUILT_PRODUCTS_DIR/Sparkle.xcframework"
xcodebuild archive -scheme Sparkle -archivePath "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO xcodebuild archive -scheme Sparkle -archivePath "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO
if [ $XCODE_VERSION_MAJOR -ge "1200" ]; then if [ $XCODE_VERSION_MAJOR -ge "1200" ]; then
xcodebuild -create-xcframework -framework "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Autoupdate.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Updater.app.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Installer.xpc.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Downloader.xpc.dSYM" -output "$BUILT_PRODUCTS_DIR/Sparkle.xcframework" xcodebuild -create-xcframework -framework "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Autoupdate.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Updater.app.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/$INSTALLER_LAUNCHER_NAME.xpc.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/$DOWNLOADER_NAME.xpc.dSYM" -output "$BUILT_PRODUCTS_DIR/Sparkle.xcframework"
else else
echo "warning: Your Xcode version does not support bundling dSYMs in XCFrameworks directly. You should copy them manually into the XCFramework." echo "warning: Your Xcode version does not support bundling dSYMs in XCFrameworks directly. You should copy them manually into the XCFramework."
echo "note: cp '$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM' '$BUILT_PRODUCTS_DIR/Sparkle.xcframework/your_architecture/dSYMs'" echo "note: cp '$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM' '$BUILT_PRODUCTS_DIR/Sparkle.xcframework/your_architecture/dSYMs'"
+9 -2
View File
@@ -326,10 +326,17 @@
} else { } else {
auxiliaryToolURL = [bundle URLForAuxiliaryExecutable:nameWithExtension]; auxiliaryToolURL = [bundle URLForAuxiliaryExecutable:nameWithExtension];
} }
assert(auxiliaryToolURL != nil);
if (auxiliaryToolURL == nil) {
SULog(SULogLevelError, @"Error: Cannot retrieve path for auxiliary tool: %@", nameWithExtension);
return nil;
}
NSURL *resolvedAuxiliaryToolURL = [auxiliaryToolURL URLByResolvingSymlinksInPath]; NSURL *resolvedAuxiliaryToolURL = [auxiliaryToolURL URLByResolvingSymlinksInPath];
assert(resolvedAuxiliaryToolURL != nil); if (resolvedAuxiliaryToolURL == nil) {
SULog(SULogLevelError, @"Error: Cannot retrieve resolved path for auxiliary tool path: %@", auxiliaryToolURL.path);
return nil;
}
return resolvedAuxiliaryToolURL.path; return resolvedAuxiliaryToolURL.path;
} }
+3 -3
View File
@@ -2,10 +2,10 @@
import PackageDescription import PackageDescription
// Version is technically not required here, SPM doesn't check // Version is technically not required here, SPM doesn't check
let version = "2.5.0-beta.2" let version = "2.5.0"
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it. // Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
let tag = "2.5.0-beta.2" let tag = "2.5.0"
let checksum = "8efa53590e1c49a2e12e472cf078ca4f263bc61c80412a8ea564939050d864ce" let checksum = "f7e6ef91edee5704b76358c9485edc63a79dfefe770d8b5340818b7db69187df"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip" let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
let package = Package( let package = Package(
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "Sparkle" s.name = "Sparkle"
s.version = "2.5.0-beta.2" s.version = "2.5.0"
s.summary = "A software update framework for macOS" s.summary = "A software update framework for macOS"
s.description = "Sparkle is an easy-to-use software update framework for macOS." s.description = "Sparkle is an easy-to-use software update framework for macOS."
s.homepage = "https://sparkle-project.org" s.homepage = "https://sparkle-project.org"
-3
View File
@@ -117,12 +117,9 @@
{ {
if (_showingUserInitiatedProgress) { if (_showingUserInitiatedProgress) {
_showingUserInitiatedProgress = NO; _showingUserInitiatedProgress = NO;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([_userDriver respondsToSelector:@selector(dismissUserInitiatedUpdateCheck)]) { if ([_userDriver respondsToSelector:@selector(dismissUserInitiatedUpdateCheck)]) {
[_userDriver dismissUserInitiatedUpdateCheck]; [_userDriver dismissUserInitiatedUpdateCheck];
} }
#pragma clang diagnostic pop
} }
} }
+30 -12
View File
@@ -115,7 +115,7 @@
} }
for (NSString *name in nodesDict) { for (NSString *name in nodesDict) {
node = [self bestNodeInNodes:[nodesDict objectForKey:name]]; node = [self bestNodeInNodes:[nodesDict objectForKey:name] name:name];
if ([name isEqualToString:SURSSElementEnclosure] || [name isEqualToString:SUAppcastElementCriticalUpdate]) { if ([name isEqualToString:SURSSElementEnclosure] || [name isEqualToString:SUAppcastElementCriticalUpdate]) {
// These are flattened as a separate dictionary for some reason // These are flattened as a separate dictionary for some reason
NSDictionary *innerDict = [self attributesOfNode:(NSXMLElement *)node]; NSDictionary *innerDict = [self attributesOfNode:(NSXMLElement *)node];
@@ -205,7 +205,7 @@
return appcastItems; return appcastItems;
} }
- (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes SPU_OBJC_DIRECT - (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes name:(NSString *)name SPU_OBJC_DIRECT
{ {
// We use this method to pick out the localized version of a node when one's available. // We use this method to pick out the localized version of a node when one's available.
if ([nodes count] == 1) if ([nodes count] == 1)
@@ -213,19 +213,37 @@
else if ([nodes count] == 0) else if ([nodes count] == 0)
return nil; return nil;
NSMutableArray *languages = [NSMutableArray array]; // Now that we reached here, we are dealing with multiple nodes
NSString *lang; NSMutableArray<NSString *> *languages = [NSMutableArray array];
NSUInteger i;
for (NSXMLElement *node in nodes) { for (NSXMLElement *node in nodes) {
lang = [[node attributeForName:@"xml:lang"] stringValue]; NSString *nodeLanguage = [[node attributeForName:SUXMLLanguage] stringValue];
[languages addObject:(lang ? lang : @"")]; NSString *language;
if (nodeLanguage.length == 0) {
language = @"en";
SULog(SULogLevelError, @"Error: Multiple nodes for %@ element are present and one of them does not have %@ attribute specified. Defaulting to %@=\"en\" but not all versions of Sparkle handle an implicit set language. Please specify the %@ attribute explicitly for all %@ elements.", name, SUXMLLanguage, SUXMLLanguage, SUXMLLanguage, name);
} else {
language = nodeLanguage;
}
[languages addObject:language];
} }
lang = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0];
i = [languages indexOfObject:([languages containsObject:lang] ? lang : @"")]; NSString *preferredLanguage = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0];
if (i == NSNotFound) { if (preferredLanguage == nil) {
i = 0; SULog(SULogLevelError, @"Error: Failed to obtain preferred localizations from %@ for node %@.", languages, name);
return [nodes objectAtIndex:0];
} }
return [nodes objectAtIndex:i];
NSUInteger preferredLanguageIndex = [languages indexOfObject:preferredLanguage];
if (preferredLanguageIndex == NSNotFound) {
SULog(SULogLevelError, @"Error: Failed to find preferred language index for %@ for node %@.", preferredLanguage, name);
return [nodes objectAtIndex:0];
}
return [nodes objectAtIndex:preferredLanguageIndex];
} }
- (SUAppcast *)copyByFilteringItems:(BOOL (^)(SUAppcastItem *))filterBlock - (SUAppcast *)copyByFilteringItems:(BOOL (^)(SUAppcastItem *))filterBlock
@@ -2,16 +2,53 @@
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"> <rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel> <channel>
<title>For unit test only</title> <title>For unit test only</title>
<!-- A release testing localized release notes --> <!-- Releases testing localized release notes -->
<!-- test other localization before implicit English !-->
<item>
<title>Version 6.3</title>
<sparkle:version>6.3</sparkle:version>
<sparkle:channel>english-later-implicit</sparkle:channel>
<pubDate>Sat, 26 Jul 2019 15:20:13 +0000</pubDate>
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" />
<sparkle:releaseNotesLink xml:lang="es">https://sparkle-project.org/notes.es.html</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink>https://sparkle-project.org/notes.en.html</sparkle:releaseNotesLink>
<sparkle:minimumSystemVersion>2.0.0</sparkle:minimumSystemVersion>
</item>
<!-- test implicit English before other localization !-->
<item>
<title>Version 6.2</title>
<sparkle:version>6.2</sparkle:version>
<sparkle:channel>english-first-implicit</sparkle:channel>
<pubDate>Sat, 26 Jul 2019 15:20:13 +0000</pubDate>
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" />
<sparkle:releaseNotesLink>https://sparkle-project.org/notes.en.html</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink xml:lang="es">https://sparkle-project.org/notes.es.html</sparkle:releaseNotesLink>
<sparkle:minimumSystemVersion>2.0.0</sparkle:minimumSystemVersion>
</item>
<!-- test English before other localization !-->
<item>
<title>Version 6.1</title>
<sparkle:version>6.1</sparkle:version>
<sparkle:channel>english-first</sparkle:channel>
<pubDate>Sat, 26 Jul 2019 15:20:13 +0000</pubDate>
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" />
<sparkle:releaseNotesLink xml:lang="en">https://sparkle-project.org/notes.en.html</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink xml:lang="es">https://sparkle-project.org/notes.es.html</sparkle:releaseNotesLink>
<sparkle:minimumSystemVersion>2.0.0</sparkle:minimumSystemVersion>
</item>
<!-- test other localization before English !-->
<item> <item>
<title>Version 6.0</title> <title>Version 6.0</title>
<sparkle:version>6.0</sparkle:version> <sparkle:version>6.0</sparkle:version>
<sparkle:channel>english-later</sparkle:channel>
<pubDate>Sat, 26 Jul 2019 15:20:13 +0000</pubDate> <pubDate>Sat, 26 Jul 2019 15:20:13 +0000</pubDate>
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" /> <enclosure url="http://localhost:1337/Sparkle_Test_App.zip" />
<sparkle:releaseNotesLink>https://sparkle-project.org/#works</sparkle:releaseNotesLink> <sparkle:releaseNotesLink xml:lang="es">https://sparkle-project.org/notes.es.html</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink xml:lang='en'> <sparkle:releaseNotesLink xml:lang="en">https://sparkle-project.org/notes.en.html</sparkle:releaseNotesLink>
https://sparkle-project.org/#localized_notes_link_works
</sparkle:releaseNotesLink>
<sparkle:minimumSystemVersion>2.0.0</sparkle:minimumSystemVersion> <sparkle:minimumSystemVersion>2.0.0</sparkle:minimumSystemVersion>
</item> </item>
</channel> </channel>
+39 -3
View File
@@ -869,15 +869,51 @@ class SUAppcastTest: XCTestCase {
ofType: "xml")! ofType: "xml")!
let testFileUrl = URL(fileURLWithPath: testFile) let testFileUrl = URL(fileURLWithPath: testFile)
XCTAssertNotNil(testFileUrl) XCTAssertNotNil(testFileUrl)
let preferredLanguage = Bundle.preferredLocalizations(from: ["en", "es"])[0]
NSLog("Using preferred locale %@", preferredLanguage)
let expectedReleaseNotesLink = (preferredLanguage == "es") ? "https://sparkle-project.org/notes.es.html" : "https://sparkle-project.org/notes.en.html"
do { do {
let testFileData = try Data(contentsOf: testFileUrl) let testFileData = try Data(contentsOf: testFileUrl)
let stateResolver = SPUAppcastItemStateResolver(hostVersion: "1.0", applicationVersionComparator: SUStandardVersionComparator.default, standardVersionComparator: SUStandardVersionComparator.default) let stateResolver = SPUAppcastItemStateResolver(hostVersion: "1.0", applicationVersionComparator: SUStandardVersionComparator.default, standardVersionComparator: SUStandardVersionComparator.default)
let appcast = try SUAppcast(xmlData: testFileData, relativeTo: testFileUrl, stateResolver: stateResolver) let fullAppcast = try SUAppcast(xmlData: testFileData, relativeTo: testFileUrl, stateResolver: stateResolver)
let items = appcast.items
XCTAssertEqual("https://sparkle-project.org/#localized_notes_link_works", items[0].releaseNotesURL!.absoluteString) do {
let appcast = SUAppcastDriver.filterAppcast(fullAppcast, forMacOSAndAllowedChannels: ["english-later"])
let items = appcast.items
XCTAssertEqual(items.count, 1)
XCTAssertEqual(items[0].versionString, "6.0")
XCTAssertEqual(expectedReleaseNotesLink, items[0].releaseNotesURL!.absoluteString)
}
do {
let appcast = SUAppcastDriver.filterAppcast(fullAppcast, forMacOSAndAllowedChannels: ["english-first"])
let items = appcast.items
XCTAssertEqual(items.count, 1)
XCTAssertEqual(items[0].versionString, "6.1")
XCTAssertEqual(expectedReleaseNotesLink, items[0].releaseNotesURL!.absoluteString)
}
do {
let appcast = SUAppcastDriver.filterAppcast(fullAppcast, forMacOSAndAllowedChannels: ["english-first-implicit"])
let items = appcast.items
XCTAssertEqual(items.count, 1)
XCTAssertEqual(items[0].versionString, "6.2")
XCTAssertEqual(expectedReleaseNotesLink, items[0].releaseNotesURL!.absoluteString)
}
do {
let appcast = SUAppcastDriver.filterAppcast(fullAppcast, forMacOSAndAllowedChannels: ["english-later-implicit"])
let items = appcast.items
XCTAssertEqual(items.count, 1)
XCTAssertEqual(items[0].versionString, "6.3")
XCTAssertEqual(expectedReleaseNotesLink, items[0].releaseNotesURL!.absoluteString)
}
} catch let err as NSError { } catch let err as NSError {
NSLog("%@", err) NSLog("%@", err)
XCTFail(err.localizedDescription) XCTFail(err.localizedDescription)
+12 -1
View File
@@ -56,7 +56,18 @@ func unarchiveUpdates(archivesSourceDir: URL, archivesDestDir: URL, disableNeste
// so we can ignore duplicate archive entries before trying to unarchive archives in parallel // so we can ignore duplicate archive entries before trying to unarchive archives in parallel
var fileEntries: [URL: URL] = [:] var fileEntries: [URL: URL] = [:]
let dir = try fileManager.contentsOfDirectory(atPath: archivesSourceDir.path) let dir = try fileManager.contentsOfDirectory(atPath: archivesSourceDir.path)
for item in dir.filter({ !$0.hasPrefix(".") && !$0.hasSuffix(".delta") && !$0.hasSuffix(".xml") && !$0.hasSuffix(".html") && !$0.hasSuffix(".txt") }) { for item in dir {
if item.hasPrefix(".") {
continue
}
let itemURL = archivesSourceDir.appendingPathComponent(item)
let fileExtension = itemURL.pathExtension
// Note: keep this list in sync with SUPipedUnarchiver
guard ["zip", "tar", "gz", "tgz", "bz2", "tbz", "xz", "txz", "lzma", "dmg"].contains(fileExtension) else {
continue
}
let itemPath = archivesSourceDir.appendingPathComponent(item) let itemPath = archivesSourceDir.appendingPathComponent(item)
// Ignore directories // Ignore directories