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
19 changed files with 153 additions and 83 deletions

No files matched your search

@@ -29,4 +29,4 @@ https://github.com/sparkle-project/Sparkle#troubleshooting
## 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
about: Problems with integration, unexpected errors using Sparkle 2
name: Sparkle doesn't work in my app
about: Problems with integration, unexpected errors using Sparkle
title: ''
labels: '2.x'
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 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
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
runs-on: ${{ matrix.macos }}
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
@@ -80,11 +83,9 @@ jobs:
- name: Post Analyzed Warnings
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:
allow-repeats: false
repo-token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
repo-token-user-login: 'Sparkle-Bot'
message: "``` ${{ steps.warnings.outputs.content }} ```"
- name: Build Release Distribution
@@ -94,13 +95,13 @@ jobs:
xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build
- name: Archive Test Results
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-logs
path: build/Logs
- name: Upload Distribution
if: ${{ success() && matrix.upload-dist }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Sparkle-distribution-${{ matrix.xcode }}.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 *> *extractTXZ = extractTGZ;
// Note: keep this list in sync with generate_appcast's unarchiveUpdates()
NSDictionary <NSString *, NSArray<NSString *> *> *extractCommandDictionary =
@{
@".zip" : @[@"/usr/bin/ditto", @"-x",@"-k",@"-"],
+1
View File
@@ -12,6 +12,7 @@
* Replace CFUUID* with NSUUID (#2395) (Eitot)
* 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)
* Fail gracefully when auxiliary tool cannot be located (#2436) (Zorg)
# 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"
// These variables must have a space after the '=' too
SPARKLE_VERSION_SUFFIX = -beta.2
CURRENT_PROJECT_VERSION = 2030
SPARKLE_VERSION_SUFFIX =
CURRENT_PROJECT_VERSION = 2031
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
ALWAYS_SEARCH_USER_PATHS = NO
+1 -1
View File
@@ -4,6 +4,6 @@ INFOPLIST_FILE = Downloader/Info.plist
WRAPPER_EXTENSION = xpc
PRODUCT_BUNDLE_IDENTIFIER = ${DOWNLOADER_BUNDLE_ID}
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
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
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
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'"
+9 -2
View File
@@ -326,10 +326,17 @@
} else {
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];
assert(resolvedAuxiliaryToolURL != nil);
if (resolvedAuxiliaryToolURL == nil) {
SULog(SULogLevelError, @"Error: Cannot retrieve resolved path for auxiliary tool path: %@", auxiliaryToolURL.path);
return nil;
}
return resolvedAuxiliaryToolURL.path;
}
+3 -3
View File
@@ -2,10 +2,10 @@
import PackageDescription
// 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.
let tag = "2.5.0-beta.2"
let checksum = "8efa53590e1c49a2e12e472cf078ca4f263bc61c80412a8ea564939050d864ce"
let tag = "2.5.0"
let checksum = "f7e6ef91edee5704b76358c9485edc63a79dfefe770d8b5340818b7db69187df"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
let package = Package(
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "2.5.0-beta.2"
s.version = "2.5.0"
s.summary = "A software update framework for macOS"
s.description = "Sparkle is an easy-to-use software update framework for macOS."
s.homepage = "https://sparkle-project.org"
-3
View File
@@ -117,12 +117,9 @@
{
if (_showingUserInitiatedProgress) {
_showingUserInitiatedProgress = NO;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([_userDriver respondsToSelector:@selector(dismissUserInitiatedUpdateCheck)]) {
[_userDriver dismissUserInitiatedUpdateCheck];
}
#pragma clang diagnostic pop
}
}
+30 -12
View File
@@ -115,7 +115,7 @@
}
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]) {
// These are flattened as a separate dictionary for some reason
NSDictionary *innerDict = [self attributesOfNode:(NSXMLElement *)node];
@@ -205,7 +205,7 @@
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.
if ([nodes count] == 1)
@@ -213,19 +213,37 @@
else if ([nodes count] == 0)
return nil;
NSMutableArray *languages = [NSMutableArray array];
NSString *lang;
NSUInteger i;
// Now that we reached here, we are dealing with multiple nodes
NSMutableArray<NSString *> *languages = [NSMutableArray array];
for (NSXMLElement *node in nodes) {
lang = [[node attributeForName:@"xml:lang"] stringValue];
[languages addObject:(lang ? lang : @"")];
NSString *nodeLanguage = [[node attributeForName:SUXMLLanguage] stringValue];
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 : @"")];
if (i == NSNotFound) {
i = 0;
NSString *preferredLanguage = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0];
if (preferredLanguage == nil) {
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
@@ -2,16 +2,53 @@
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<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>
<title>Version 6.0</title>
<sparkle:version>6.0</sparkle:version>
<sparkle:channel>english-later</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/#works</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink xml:lang='en'>
https://sparkle-project.org/#localized_notes_link_works
</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink xml:lang="es">https://sparkle-project.org/notes.es.html</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink xml:lang="en">https://sparkle-project.org/notes.en.html</sparkle:releaseNotesLink>
<sparkle:minimumSystemVersion>2.0.0</sparkle:minimumSystemVersion>
</item>
</channel>
+39 -3
View File
@@ -869,15 +869,51 @@ class SUAppcastTest: XCTestCase {
ofType: "xml")!
let testFileUrl = URL(fileURLWithPath: testFile)
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 {
let testFileData = try Data(contentsOf: testFileUrl)
let stateResolver = SPUAppcastItemStateResolver(hostVersion: "1.0", applicationVersionComparator: SUStandardVersionComparator.default, standardVersionComparator: SUStandardVersionComparator.default)
let appcast = 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)
let fullAppcast = try SUAppcast(xmlData: testFileData, relativeTo: testFileUrl, stateResolver: stateResolver)
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 {
NSLog("%@", err)
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
var fileEntries: [URL: URL] = [:]
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)
// Ignore directories