mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-23 04:34:27 +00:00
Compare commits
11
Commits
2.1.0-beta.1
...
2.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
286edd1fa2 | ||
|
|
242ba4e5c4 | ||
|
|
8edc77fdb2 | ||
|
|
eb938ad15a | ||
|
|
18c751eaf9 | ||
|
|
94b48c45e7 | ||
|
|
e8fea3481a | ||
|
|
8ea4d705f5 | ||
|
|
ac2ef612bc | ||
|
|
84252a64f8 | ||
|
|
930ea303fd |
No files matched your search
@@ -81,16 +81,18 @@ id<SPUDeltaArchiveProtocol> SPUDeltaArchiveReadPatchAndHeader(NSString *patchFil
|
||||
|
||||
@synthesize compression = _compression;
|
||||
@synthesize compressionLevel = _compressionLevel;
|
||||
@synthesize fileSystemCompression = _fileSystemCompression;
|
||||
@synthesize majorVersion = _majorVersion;
|
||||
@synthesize minorVersion = _minorVersion;
|
||||
|
||||
- (instancetype)initWithCompression:(SPUDeltaCompressionMode)compression compressionLevel:(uint8_t)compressionLevel majorVersion:(uint16_t)majorVersion minorVersion:(uint16_t)minorVersion beforeTreeHash:(const unsigned char *)beforeTreeHash afterTreeHash:(const unsigned char *)afterTreeHash
|
||||
- (instancetype)initWithCompression:(SPUDeltaCompressionMode)compression compressionLevel:(uint8_t)compressionLevel fileSystemCompression:(bool)fileSystemCompression majorVersion:(uint16_t)majorVersion minorVersion:(uint16_t)minorVersion beforeTreeHash:(const unsigned char *)beforeTreeHash afterTreeHash:(const unsigned char *)afterTreeHash
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
_compression = compression;
|
||||
_compressionLevel = compressionLevel;
|
||||
_fileSystemCompression = fileSystemCompression;
|
||||
|
||||
_majorVersion = majorVersion;
|
||||
_minorVersion = minorVersion;
|
||||
|
||||
@@ -26,10 +26,11 @@ typedef NS_ENUM(uint8_t, SPUDeltaItemCommands) {
|
||||
// Represents header for our archive
|
||||
@interface SPUDeltaArchiveHeader : NSObject
|
||||
|
||||
- (instancetype)initWithCompression:(SPUDeltaCompressionMode)compression compressionLevel:(uint8_t)compressionLevel majorVersion:(uint16_t)majorVersion minorVersion:(uint16_t)minorVersion beforeTreeHash:(const unsigned char *)beforeTreeHash afterTreeHash:(const unsigned char *)afterTreeHash;
|
||||
- (instancetype)initWithCompression:(SPUDeltaCompressionMode)compression compressionLevel:(uint8_t)compressionLevel fileSystemCompression:(bool)fileSystemCompression majorVersion:(uint16_t)majorVersion minorVersion:(uint16_t)minorVersion beforeTreeHash:(const unsigned char *)beforeTreeHash afterTreeHash:(const unsigned char *)afterTreeHash;
|
||||
|
||||
@property (nonatomic, readonly) SPUDeltaCompressionMode compression;
|
||||
@property (nonatomic, readonly) uint8_t compressionLevel;
|
||||
@property (nonatomic, readonly) bool fileSystemCompression;
|
||||
@property (nonatomic, readonly) uint16_t majorVersion;
|
||||
@property (nonatomic, readonly) uint16_t minorVersion;
|
||||
@property (nonatomic, readonly) unsigned char *beforeTreeHash;
|
||||
|
||||
@@ -39,7 +39,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
[ HEADER (part 1) ]
|
||||
magic (length: 4)
|
||||
compression (length: 1)
|
||||
compressionLevel (length: 1)
|
||||
metadata (See format below. length: 1)
|
||||
|
||||
-- METADATA --
|
||||
compressionLevel (bits [0, 4])
|
||||
(bits [5, 6] reserved)
|
||||
fileSystemCompression (bit 7)
|
||||
|
||||
-- COMPRESSED --
|
||||
|
||||
|
||||
@@ -21,6 +21,13 @@
|
||||
#define SPARKLE_BZIP2_ERROR_DOMAIN @"Sparkle BZIP2"
|
||||
#define SPARKLE_COMPRESSION_ERROR_DOMAIN @"Sparkle Compression"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t compressionLevel : 4;
|
||||
uint8_t reserved : 3;
|
||||
bool fileSystemCompression : 1;
|
||||
} SparkleDeltaArchiveMetadata;
|
||||
|
||||
@interface SPUSparkleDeltaArchive ()
|
||||
|
||||
@property (nonatomic) FILE *file;
|
||||
@@ -267,8 +274,8 @@ static compression_algorithm _compressionAlgorithmForMode(SPUDeltaCompressionMod
|
||||
|
||||
self.compression = compression;
|
||||
|
||||
uint8_t compressionLevel = 0;
|
||||
if (fread(&compressionLevel, sizeof(compressionLevel), 1, file) < 1) {
|
||||
SparkleDeltaArchiveMetadata metadata = {0};
|
||||
if (fread(&metadata, sizeof(metadata), 1, file) < 1) {
|
||||
self.error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to read compression level value from patch file: %@", patchFile] }];
|
||||
return nil;
|
||||
}
|
||||
@@ -338,7 +345,7 @@ static compression_algorithm _compressionAlgorithmForMode(SPUDeltaCompressionMod
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [[SPUDeltaArchiveHeader alloc] initWithCompression:compression compressionLevel:compressionLevel majorVersion:majorVersion minorVersion:minorVersion beforeTreeHash:beforeTreeHash afterTreeHash:afterTreeHash];
|
||||
return [[SPUDeltaArchiveHeader alloc] initWithCompression:compression compressionLevel:metadata.compressionLevel fileSystemCompression:metadata.fileSystemCompression majorVersion:majorVersion minorVersion:minorVersion beforeTreeHash:beforeTreeHash afterTreeHash:afterTreeHash];
|
||||
}
|
||||
|
||||
- (NSArray<NSString *> *)_readRelativeFilePaths
|
||||
@@ -770,8 +777,10 @@ static compression_algorithm _compressionAlgorithmForMode(SPUDeltaCompressionMod
|
||||
compressionLevel = 0;
|
||||
}
|
||||
|
||||
if (fwrite(&compressionLevel, sizeof(compressionLevel), 1, file) < 1) {
|
||||
self.error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{ NSLocalizedDescriptionKey: @"Failed to write compression level value due to io error" }];
|
||||
SparkleDeltaArchiveMetadata metadata = {.compressionLevel = compressionLevel, .fileSystemCompression = header.fileSystemCompression};
|
||||
|
||||
if (fwrite(&metadata, sizeof(metadata), 1, file) < 1) {
|
||||
self.error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{ NSLocalizedDescriptionKey: @"Failed to write metadata value due to io error" }];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
|
||||
|
||||
// I wasn't able to figure out how to retrieve the compression options from xar,
|
||||
// so we will use default flags to indicate the info isn't available
|
||||
return [[SPUDeltaArchiveHeader alloc] initWithCompression:SPUDeltaCompressionModeDefault compressionLevel:0 majorVersion:majorDiffVersion minorVersion:minorDiffVersion beforeTreeHash:rawExpectedBeforeHash afterTreeHash:rawExpectedAfterHash];
|
||||
return [[SPUDeltaArchiveHeader alloc] initWithCompression:SPUDeltaCompressionModeDefault compressionLevel:0 fileSystemCompression:false majorVersion:majorDiffVersion minorVersion:minorDiffVersion beforeTreeHash:rawExpectedBeforeHash afterTreeHash:rawExpectedAfterHash];
|
||||
}
|
||||
|
||||
- (void)writeHeader:(SPUDeltaArchiveHeader *)header
|
||||
|
||||
@@ -28,7 +28,7 @@ static BOOL applyBinaryDeltaToFile(NSString *patchFile, NSString *sourceFilePath
|
||||
return success;
|
||||
}
|
||||
|
||||
BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFile, BOOL verbose, void (^progressCallback)(double progress), NSError *__autoreleasing *error)
|
||||
BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *patchFile, BOOL verbose, void (^progressCallback)(double progress), NSError *__autoreleasing *error)
|
||||
{
|
||||
SPUDeltaArchiveHeader *header = nil;
|
||||
id<SPUDeltaArchiveProtocol> archive = SPUDeltaArchiveReadPatchAndHeader(patchFile, &header);
|
||||
@@ -39,7 +39,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
return NO;
|
||||
}
|
||||
|
||||
progressCallback(0/6.0);
|
||||
progressCallback(0/7.0);
|
||||
|
||||
SUBinaryDeltaMajorVersion majorDiffVersion = header.majorVersion;
|
||||
uint16_t minorDiffVersion = header.minorVersion;
|
||||
@@ -90,7 +90,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
fprintf(stderr, "Verifying source...");
|
||||
}
|
||||
|
||||
progressCallback(1/6.0);
|
||||
progressCallback(1/7.0);
|
||||
|
||||
unsigned char beforeHash[CC_SHA1_DIGEST_LENGTH] = {0};
|
||||
if (!getRawHashOfTreeWithVersion(beforeHash, source, majorDiffVersion)) {
|
||||
@@ -117,7 +117,17 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
fprintf(stderr, "\nCopying files...");
|
||||
}
|
||||
|
||||
progressCallback(2/6.0);
|
||||
progressCallback(2/7.0);
|
||||
|
||||
// Make a temporary destination path if necessary
|
||||
// If we want to apply file system compression after we're done applying, we'll need to use a different
|
||||
// temporary path
|
||||
NSString *destination;
|
||||
if (header.fileSystemCompression) {
|
||||
destination = [finalDestination.stringByDeletingLastPathComponent stringByAppendingPathComponent:[NSString stringWithFormat:@".tmp.%@", finalDestination.lastPathComponent]];
|
||||
} else {
|
||||
destination = finalDestination;
|
||||
}
|
||||
|
||||
if (!removeTree(destination)) {
|
||||
if (verbose) {
|
||||
@@ -129,7 +139,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
return NO;
|
||||
}
|
||||
|
||||
progressCallback(3/6.0);
|
||||
progressCallback(3/7.0);
|
||||
|
||||
if (!copyTree(source, destination)) {
|
||||
if (verbose) {
|
||||
@@ -141,7 +151,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
return NO;
|
||||
}
|
||||
|
||||
progressCallback(4/6.0);
|
||||
progressCallback(4/7.0);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\nPatching...");
|
||||
@@ -374,23 +384,85 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
if (error != NULL && *error == nil) {
|
||||
*error = archiveError;
|
||||
}
|
||||
removeTree(destination);
|
||||
return NO;
|
||||
}
|
||||
|
||||
progressCallback(5/6.0);
|
||||
|
||||
progressCallback(5/7.0);
|
||||
|
||||
// Re-apply file system compression is requested
|
||||
if (header.fileSystemCompression) {
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\nApplying file system compression...");
|
||||
}
|
||||
|
||||
NSTask *dittoTask = [[NSTask alloc] init];
|
||||
|
||||
if (@available(macOS 10.13, *)) {
|
||||
dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO];
|
||||
} else {
|
||||
dittoTask.launchPath = @"/usr/bin/ditto";
|
||||
}
|
||||
|
||||
dittoTask.arguments = @[@"--hfsCompression", destination, finalDestination];
|
||||
|
||||
// If we fail to apply file system compression, we will try falling back to not doing this
|
||||
BOOL failedToApplyFileSystemCompression = NO;
|
||||
|
||||
if (@available(macOS 10.13, *)) {
|
||||
NSError *launchError = nil;
|
||||
if (![dittoTask launchAndReturnError:&launchError]) {
|
||||
failedToApplyFileSystemCompression = YES;
|
||||
|
||||
fprintf(stderr, "\nWarning: failed to launch ditto task for file compression: %s", launchError.localizedDescription.UTF8String);
|
||||
}
|
||||
} else {
|
||||
@try {
|
||||
[dittoTask launch];
|
||||
} @catch (NSException *exception) {
|
||||
failedToApplyFileSystemCompression = YES;
|
||||
|
||||
fprintf(stderr, "\nWarning: failed to launch ditto task for file compression: %s", exception.reason.UTF8String);
|
||||
}
|
||||
}
|
||||
|
||||
if (!failedToApplyFileSystemCompression) {
|
||||
[dittoTask waitUntilExit];
|
||||
|
||||
if (dittoTask.terminationStatus != 0) {
|
||||
failedToApplyFileSystemCompression = YES;
|
||||
|
||||
fprintf(stderr, "\nWarning: ditto task for file compression returned exit status %d", dittoTask.terminationStatus);
|
||||
}
|
||||
}
|
||||
|
||||
if (failedToApplyFileSystemCompression) {
|
||||
// Try to replace bundle normally
|
||||
if (![fileManager replaceItemAtURL:[NSURL fileURLWithPath:finalDestination] withItemAtURL:[NSURL fileURLWithPath:destination isDirectory:YES] backupItemName:nil options:0 resultingItemURL:NULL error:error]) {
|
||||
removeTree(destination);
|
||||
return NO;
|
||||
}
|
||||
} else {
|
||||
// Remove original copy
|
||||
[fileManager removeItemAtURL:[NSURL fileURLWithPath:destination isDirectory:YES] error:NULL];
|
||||
}
|
||||
}
|
||||
|
||||
progressCallback(6/7.0);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\nVerifying destination...");
|
||||
}
|
||||
|
||||
unsigned char afterHash[CC_SHA1_DIGEST_LENGTH] = {0};
|
||||
if (!getRawHashOfTreeWithVersion(afterHash, destination, majorDiffVersion)) {
|
||||
if (!getRawHashOfTreeWithVersion(afterHash, finalDestination, majorDiffVersion)) {
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Unable to calculate hash of tree %@", destination] }];
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Unable to calculate hash of tree %@", finalDestination] }];
|
||||
}
|
||||
removeTree(finalDestination);
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -401,11 +473,11 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Destination doesn't have expected hash (%@ != %@). Giving up.", displayHashFromRawHash(expectedAfterHash), displayHashFromRawHash(afterHash)] }];
|
||||
}
|
||||
removeTree(destination);
|
||||
removeTree(finalDestination);
|
||||
return NO;
|
||||
}
|
||||
|
||||
progressCallback(6/6.0);
|
||||
progressCallback(7/7.0);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\nDone!\n");
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <xlocale.h>
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@@ -89,7 +90,7 @@ NSString *deltaCompressionStringFromMode(SPUDeltaCompressionMode mode)
|
||||
|
||||
int compareFiles(const FTSENT **a, const FTSENT **b)
|
||||
{
|
||||
return strcoll((*a)->fts_name, (*b)->fts_name);
|
||||
return strcoll_l((*a)->fts_name, (*b)->fts_name, _c_locale);
|
||||
}
|
||||
|
||||
NSString *pathRelativeToDirectory(NSString *directory, NSString *path)
|
||||
|
||||
@@ -517,6 +517,8 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
bool foundFilesystemCompression = false;
|
||||
|
||||
uint32_t warningsCount = 0;
|
||||
const uint32_t maxWarningsToPrint = 16;
|
||||
@@ -584,6 +586,17 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
fprintf(stderr, "\nWarning: encountered too many warnings.. Ignoring the rest..");
|
||||
}
|
||||
}
|
||||
|
||||
// If we find any executable files that are using file system compression, that is sufficient
|
||||
// for recording that the applier should re-apply file system compression.
|
||||
// We check for executable files because they are likely candidates to be compressed.
|
||||
if (!foundFilesystemCompression && MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion3) && ent->fts_info == FTS_F && (ent->fts_statp->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0 && (ent->fts_statp->st_flags & UF_COMPRESSED) != 0) {
|
||||
foundFilesystemCompression = true;
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, " File system compression detected.");
|
||||
}
|
||||
}
|
||||
|
||||
NSDictionary *oldInfo = originalTreeState[key];
|
||||
|
||||
@@ -646,7 +659,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
archive = [[SPUXarDeltaArchive alloc] initWithPatchFileForWriting:temporaryFile];
|
||||
}
|
||||
|
||||
SPUDeltaArchiveHeader *header = [[SPUDeltaArchiveHeader alloc] initWithCompression:compression compressionLevel:compressionLevel majorVersion:majorVersion minorVersion:minorVersion beforeTreeHash:beforeHash afterTreeHash:afterHash];
|
||||
SPUDeltaArchiveHeader *header = [[SPUDeltaArchiveHeader alloc] initWithCompression:compression compressionLevel:compressionLevel fileSystemCompression:foundFilesystemCompression majorVersion:majorVersion minorVersion:minorVersion beforeTreeHash:beforeHash afterTreeHash:afterHash];
|
||||
|
||||
[archive writeHeader:header];
|
||||
if (archive.error != nil) {
|
||||
|
||||
@@ -2,13 +2,20 @@
|
||||
|
||||
* New Binary Delta format (version 3)
|
||||
* Features a custom and more efficient container format, migrating away from the deprecated xar format (Zorg) (#2051)
|
||||
* Adds compression options for lzma, bzip2, zlib, lzfse, lz4, and no compression (Zorg) (#2051)
|
||||
* Changes default format compression from bzip2 (in version 2) to lzma (in version 3) resulting in smaller deltas (Zorg) (#2051)
|
||||
* Adds delta compression options for lzma, bzip2, zlib, lzfse, lz4, and no compression (Zorg) (#2051)
|
||||
* Changes default delta format compression from bzip2 (in version 2) to lzma (in version 3) resulting in smaller deltas (Zorg) (#2051)
|
||||
* Preserve file system (HFS+/apfs) level compression when applying delta updates (Zorg) (#2084)
|
||||
* Tracks renames and binary diffs for files that have moved around to new locations using intelligent heuristics (Zorg) (#2051, #2053)
|
||||
* Added more unit tests, UI tests, and generate_appcast/BinaryDelta tools support for the new format (Zorg) (#2052, #2054)
|
||||
* Major upgrade improvements (#2070)
|
||||
* Fix skipping a major version to not skip subsequent major versions (Zorg) (#2079)
|
||||
* Add sparkle:belowVersion element for informational updates (Zorg) (#2080)
|
||||
* Add option to allow developers to ignore/reset user skipped upgrades (Zorg) (#2081)
|
||||
* Fix progress bar and button alignment for checking updates (Zorg) (#2066)
|
||||
* This deprecates `-[SPUUserDriver showInstallingUpdate]` and `-[SPUUserDriver showSendingTerminationSignal]` in favor for `-[SPUUserDriver showInstallingUpdateWithApplicationTerminated:]`
|
||||
* Fix unsteady progress when installing updates (Zorg) (#2072)
|
||||
* Check http statusCode in didFinishDownloadingToURL (Eric Shapiro, Zorg) (#2049, #2073)
|
||||
* Use strcoll_l() for locale-independent comparisons for delta updates (Dan Rigdon-Bel) (#2087)
|
||||
* Fix version compare not treating '2.1.0' and '2.1' as being equal (Zorg) (#2065)
|
||||
* Add verify and account options for signing updates (Zorg) (#2074)
|
||||
* Add delta patch and Apple code signing verification in generate_appcast (Zorg) (#2076, #2077)
|
||||
@@ -18,6 +25,8 @@
|
||||
* Preserve the Entitlements directory in podspec (digitalMoksha) (#2062)
|
||||
* Add hidden option to generate_appcast to set max CDATA threshold (Zorg) (#2075)
|
||||
|
||||
This update introduces a new major format for [delta updates](https://sparkle-project.org/documentation/delta-updates/), which migrates away from deprecated APIs (xar) and creates smaller patches. If you don't use `generate_appcast`, please check the [compatibility notes for creating delta updates](https://sparkle-project.org/documentation/delta-updates/#compatibility).
|
||||
|
||||
# 2.0.0
|
||||
|
||||
* Support for Sandboxed Applications (Zorg)
|
||||
|
||||
+1
-1
@@ -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"}
|
||||
{"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"}
|
||||
@@ -39,8 +39,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.1
|
||||
CURRENT_PROJECT_VERSION = 2011
|
||||
SPARKLE_VERSION_SUFFIX =
|
||||
CURRENT_PROJECT_VERSION = 2013
|
||||
|
||||
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
+3
-3
@@ -2,10 +2,10 @@
|
||||
import PackageDescription
|
||||
|
||||
// Version is technically not required here, SPM doesn't check
|
||||
let version = "2.1.0-beta.1"
|
||||
let version = "2.1.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.1.0-beta.1"
|
||||
let checksum = "d555665e21a956b87ebeabd56b3522f7e81c5e89c258b320c3d75661ee6b573c"
|
||||
let tag = "2.1.0"
|
||||
let checksum = "6a540f9bd4ef096b6229f134a6b98dea265c8f89ede418b50d49fc49d7fe0b46"
|
||||
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
let package = Package(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Sparkle"
|
||||
s.version = "2.1.0-beta.1"
|
||||
s.version = "2.1.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"
|
||||
|
||||
@@ -137,6 +137,8 @@
|
||||
720AC2C92618E89500E25A3E /* SUAppcastItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5FC5409C5182000B25A18 /* SUAppcastItem.m */; };
|
||||
720AC2DC2618E8A500E25A3E /* SPUSecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E075B1CA3A6D6001A286B /* SPUSecureCoding.m */; };
|
||||
720B16451C66433D006985FB /* SUTestApplicationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 720B16431C66433D006985FB /* SUTestApplicationTest.swift */; };
|
||||
720DC50427A51A6500DFF3EC /* testappcast_minimumAutoupdateVersionSkipping.xml in Resources */ = {isa = PBXBuildFile; fileRef = 720DC50327A51A6500DFF3EC /* testappcast_minimumAutoupdateVersionSkipping.xml */; };
|
||||
720DC50627A62CDC00DFF3EC /* testappcast_minimumAutoupdateVersionSkipping2.xml in Resources */ = {isa = PBXBuildFile; fileRef = 720DC50527A62CDC00DFF3EC /* testappcast_minimumAutoupdateVersionSkipping2.xml */; };
|
||||
720E217B1D0D00BF003A311C /* SPUUpdaterCycle.h in Headers */ = {isa = PBXBuildFile; fileRef = 720E21791D0D00BF003A311C /* SPUUpdaterCycle.h */; };
|
||||
720E217C1D0D00BF003A311C /* SPUUpdaterCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 720E217A1D0D00BF003A311C /* SPUUpdaterCycle.m */; };
|
||||
7210C7681B9A9A1500EB90AC /* SUUnarchiverTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */; };
|
||||
@@ -973,6 +975,8 @@
|
||||
720B16431C66433D006985FB /* SUTestApplicationTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SUTestApplicationTest.swift; path = UITests/SUTestApplicationTest.swift; sourceTree = SOURCE_ROOT; };
|
||||
720B4C2325EBFAFD005A0592 /* link-tools.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "link-tools.sh"; sourceTree = "<group>"; };
|
||||
720C192827127A3800740C8E /* release-move-tag.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "release-move-tag.sh"; sourceTree = "<group>"; };
|
||||
720DC50327A51A6500DFF3EC /* testappcast_minimumAutoupdateVersionSkipping.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast_minimumAutoupdateVersionSkipping.xml; sourceTree = "<group>"; };
|
||||
720DC50527A62CDC00DFF3EC /* testappcast_minimumAutoupdateVersionSkipping2.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast_minimumAutoupdateVersionSkipping2.xml; sourceTree = "<group>"; };
|
||||
720E21791D0D00BF003A311C /* SPUUpdaterCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUUpdaterCycle.h; sourceTree = "<group>"; };
|
||||
720E217A1D0D00BF003A311C /* SPUUpdaterCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUUpdaterCycle.m; sourceTree = "<group>"; };
|
||||
7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUUnarchiverTest.swift; sourceTree = "<group>"; };
|
||||
@@ -1764,6 +1768,8 @@
|
||||
5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */,
|
||||
723EDC3E26885A8E000BCBA4 /* testappcast_channels.xml */,
|
||||
725B3A81263FBF0C0041AB8E /* testappcast_minimumAutoupdateVersion.xml */,
|
||||
720DC50327A51A6500DFF3EC /* testappcast_minimumAutoupdateVersionSkipping.xml */,
|
||||
720DC50527A62CDC00DFF3EC /* testappcast_minimumAutoupdateVersionSkipping2.xml */,
|
||||
7202DC99269ABD3500737EC4 /* testappcast_phasedRollout.xml */,
|
||||
722545B526805FF80036465C /* testappcast_info_updates.xml */,
|
||||
5F1510A11C96E591006E1629 /* testnamespaces.xml */,
|
||||
@@ -3036,6 +3042,7 @@
|
||||
725B3A82263FBF0C0041AB8E /* testappcast_minimumAutoupdateVersion.xml in Resources */,
|
||||
14958C6E19AEBC950061B14F /* signed-test-file.txt in Resources */,
|
||||
723EDC3F26885A8E000BCBA4 /* testappcast_channels.xml in Resources */,
|
||||
720DC50427A51A6500DFF3EC /* testappcast_minimumAutoupdateVersionSkipping.xml in Resources */,
|
||||
72AC6B2E1B9B218C00F62325 /* SparkleTestCodeSignApp.dmg in Resources */,
|
||||
C23E885B1BE7B24F0050BB73 /* SparkleTestCodeSignApp.enc.dmg in Resources */,
|
||||
72AC6B281B9AAD6700F62325 /* SparkleTestCodeSignApp.tar in Resources */,
|
||||
@@ -3049,6 +3056,7 @@
|
||||
14958C6F19AEBC980061B14F /* test-pubkey.pem in Resources */,
|
||||
5AF6C74F1AEA46D10014A3AB /* test.pkg in Resources */,
|
||||
72BC6C3D275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg in Resources */,
|
||||
720DC50627A62CDC00DFF3EC /* testappcast_minimumAutoupdateVersionSkipping2.xml in Resources */,
|
||||
5AD0FA7F1C73F2E2004BCEFF /* testappcast.xml in Resources */,
|
||||
FA30773D24CBC295007BA37D /* testlocalizedreleasenotesappcast.xml in Resources */,
|
||||
72CCDEBE27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip in Resources */,
|
||||
|
||||
Vendored
-3
@@ -95,9 +95,6 @@
|
||||
/* Title confirmation for skipping major upgrade and future updates */
|
||||
"Are you sure you want to skip this upgrade?" = "Are you sure you want to skip this upgrade?";
|
||||
|
||||
/* Confirmation message for skipping major upgrade and future updates */
|
||||
"Skipping this major upgrade will opt out of alerts for future updates." = "Skipping this major upgrade will opt out of alerts for future updates.";
|
||||
|
||||
/* Skipping major upgrade */
|
||||
"Skip Upgrade" = "Skip Upgrade";
|
||||
|
||||
|
||||
+15
-1
@@ -98,8 +98,22 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
NSString *hostVersion = self.hostVersion;
|
||||
|
||||
// Informational update only for a set of host versions we're updating from
|
||||
return [informationalUpdateVersions containsObject:self.hostVersion];
|
||||
if ([informationalUpdateVersions containsObject:hostVersion]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
// If an informational update version has a '<' prefix, this is an informational update if
|
||||
// hostVersion < this info update version
|
||||
for (NSString *informationalUpdateVersion in informationalUpdateVersions) {
|
||||
if ([informationalUpdateVersion hasPrefix:@"<"] && [self.applicationVersionComparator compareVersion:hostVersion toVersion:[informationalUpdateVersion substringFromIndex:1]] == NSOrderedAscending) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (SPUAppcastItemState *)resolveStateWithInformationalUpdateVersions:(NSSet<NSString *> * _Nullable)informationalUpdateVersions minimumOperatingSystemVersion:(NSString * _Nullable)minimumOperatingSystemVersion maximumOperatingSystemVersion:(NSString * _Nullable)maximumOperatingSystemVersion minimumAutoupdateVersion:(NSString * _Nullable)minimumAutoupdateVersion criticalUpdateDictionary:(NSDictionary * _Nullable)criticalUpdateDictionary
|
||||
|
||||
Vendored
+4
-2
@@ -27,12 +27,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+ (void)skipUpdate:(SUAppcastItem *)updateItem host:(SUHost *)host;
|
||||
|
||||
// At least one of minorVersion or majorVersion should be non-nil
|
||||
- (instancetype)initWithMinorVersion:(nullable NSString *)minorVersion majorVersion:(nullable NSString *)majorVersion;
|
||||
- (instancetype)initWithMinorVersion:(nullable NSString *)minorVersion majorVersion:(nullable NSString *)majorVersion majorSubreleaseVersion:(nullable NSString *)majorSubreleaseVersion;
|
||||
|
||||
// At least one of these version properties will be non-nil
|
||||
// At least one of these two version properties will be non-nil
|
||||
@property (nonatomic, readonly, nullable) NSString *minorVersion;
|
||||
@property (nonatomic, readonly, nullable) NSString *majorVersion;
|
||||
|
||||
@property (nonatomic, readonly, nullable) NSString *majorSubreleaseVersion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Vendored
+9
-3
@@ -18,13 +18,15 @@
|
||||
|
||||
@synthesize minorVersion = _minorVersion;
|
||||
@synthesize majorVersion = _majorVersion;
|
||||
@synthesize majorSubreleaseVersion = _majorSubreleaseVersion;
|
||||
|
||||
- (instancetype)initWithMinorVersion:(nullable NSString *)minorVersion majorVersion:(nullable NSString *)majorVersion
|
||||
- (instancetype)initWithMinorVersion:(nullable NSString *)minorVersion majorVersion:(nullable NSString *)majorVersion majorSubreleaseVersion:(nullable NSString *)majorSubreleaseVersion
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_minorVersion = [minorVersion copy];
|
||||
_majorVersion = [majorVersion copy];
|
||||
_majorSubreleaseVersion = [majorSubreleaseVersion copy];
|
||||
|
||||
assert(_minorVersion != nil || _majorVersion != nil);
|
||||
}
|
||||
@@ -35,9 +37,10 @@
|
||||
{
|
||||
NSString *minorVersion = [host objectForUserDefaultsKey:SUSkippedMinorVersionKey];
|
||||
NSString *majorVersion = [host objectForUserDefaultsKey:SUSkippedMajorVersionKey];
|
||||
NSString *majorSubreleaseVersion = [host objectForUserDefaultsKey:SUSkippedMajorSubreleaseVersionKey];
|
||||
|
||||
if (minorVersion != nil || majorVersion != nil) {
|
||||
return [[SPUSkippedUpdate alloc] initWithMinorVersion:minorVersion majorVersion:majorVersion];
|
||||
return [[SPUSkippedUpdate alloc] initWithMinorVersion:minorVersion majorVersion:majorVersion majorSubreleaseVersion:majorSubreleaseVersion];
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
@@ -47,17 +50,20 @@
|
||||
{
|
||||
[host setObject:nil forUserDefaultsKey:SUSkippedMinorVersionKey];
|
||||
[host setObject:nil forUserDefaultsKey:SUSkippedMajorVersionKey];
|
||||
[host setObject:nil forUserDefaultsKey:SUSkippedMajorSubreleaseVersionKey];
|
||||
}
|
||||
|
||||
+ (void)skipUpdate:(SUAppcastItem *)updateItem host:(SUHost *)host
|
||||
{
|
||||
NSString *version = updateItem.versionString;
|
||||
|
||||
if (updateItem.majorUpgrade) {
|
||||
NSString *majorVersion = updateItem.minimumAutoupdateVersion;
|
||||
assert(majorVersion != nil);
|
||||
|
||||
[host setObject:majorVersion forUserDefaultsKey:SUSkippedMajorVersionKey];
|
||||
[host setObject:version forUserDefaultsKey:SUSkippedMajorSubreleaseVersionKey];
|
||||
} else {
|
||||
NSString *version = updateItem.versionString;
|
||||
[host setObject:version forUserDefaultsKey:SUSkippedMinorVersionKey];
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -177,6 +177,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
this permission request is not performed however.
|
||||
|
||||
Setting this property will persist in the host bundle's user defaults.
|
||||
Only set this property if you need dynamic behavior (e.g. user preferences).
|
||||
|
||||
The update schedule cycle will be reset in a short delay after the property's new value is set.
|
||||
This is to allow reverting this property without kicking off a schedule change immediately
|
||||
|
||||
Vendored
+1
-1
@@ -85,7 +85,7 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
|
||||
* If the state.stage is `SPUUserUpdateStateInstalling`, the installing update is also preserved after dismissing. In this state however, the update will also still be installed after the application is terminated.
|
||||
*
|
||||
* A reply of `SPUUserUpdateChoiceSkip` skips this particular version and won't notify the user again, unless they initiate an update check themselves.
|
||||
* If @c appcastItem.majorUpgrade is YES, the major update and any future minor updates to that major release are skipped.
|
||||
* If @c appcastItem.majorUpgrade is YES, the major update and any future minor updates to that major release are skipped, unless a future minor update specifies a `<sparkle:ignoreSkippedUpgradesBelowVersion>` requirement.
|
||||
* If the state.stage is `SPUUpdateStateInstalling`, the installation is also canceled when the update is skipped.
|
||||
*
|
||||
* @param appcastItem The Appcast Item containing information that reflects the new update.
|
||||
|
||||
Vendored
+7
-1
@@ -159,11 +159,17 @@
|
||||
NSMutableSet *informationalUpdateVersions = [NSMutableSet set];
|
||||
NSEnumerator *childEnum = [[node children] objectEnumerator];
|
||||
for (NSXMLNode *child in childEnum) {
|
||||
if ([child.name isEqualToString:SUAppcastAttributeVersion]) {
|
||||
if ([child.name isEqualToString:SUAppcastElementVersion]) {
|
||||
NSString *version = child.stringValue;
|
||||
if (version != nil) {
|
||||
[informationalUpdateVersions addObject:version];
|
||||
}
|
||||
} else if ([child.name isEqualToString:SUAppcastElementBelowVersion]) {
|
||||
NSString *version = child.stringValue;
|
||||
if (version != nil) {
|
||||
// Denote version is used as an upper bound by using '<'
|
||||
[informationalUpdateVersions addObject:[NSString stringWithFormat:@"<%@", version]];
|
||||
}
|
||||
}
|
||||
}
|
||||
[dict setObject:[informationalUpdateVersions copy] forKey:name];
|
||||
|
||||
Vendored
+5
-3
@@ -334,10 +334,12 @@
|
||||
+ (BOOL)item:(SUAppcastItem *)ui containsSkippedUpdate:(SPUSkippedUpdate * _Nullable)skippedUpdate hostPassesSkippedMajorVersion:(BOOL)hostPassesSkippedMajorVersion versionComparator:(id<SUVersionComparison>)versionComparator
|
||||
{
|
||||
NSString *skippedMajorVersion = skippedUpdate.majorVersion;
|
||||
NSString *skippedMajorSubreleaseVersion = skippedUpdate.majorSubreleaseVersion;
|
||||
|
||||
if (!hostPassesSkippedMajorVersion && skippedMajorVersion != nil && [versionComparator compareVersion:skippedMajorVersion toVersion:ui.versionString] != NSOrderedDescending) {
|
||||
// Item is on a greater or equal version than a major version we've skipped
|
||||
// So we skip this item
|
||||
if (!hostPassesSkippedMajorVersion && skippedMajorVersion != nil && ui.minimumAutoupdateVersion != nil && [versionComparator compareVersion:skippedMajorVersion toVersion:(NSString * _Nonnull)ui.minimumAutoupdateVersion] != NSOrderedAscending && (ui.ignoreSkippedUpgradesBelowVersion == nil || (skippedMajorSubreleaseVersion != nil && [versionComparator compareVersion:skippedMajorSubreleaseVersion toVersion:(NSString * _Nonnull)ui.ignoreSkippedUpgradesBelowVersion] != NSOrderedAscending))) {
|
||||
// If skipped major version is >= than the item's minimumAutoupdateVersion, we can skip the item.
|
||||
// But if there is an ignoreSkippedUpgradesBelowVersion, we can only skip the item if the last skipped subrelease
|
||||
// version is >= than that version provided by the item
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+16
-1
@@ -265,9 +265,11 @@ SU_EXPORT @interface SUAppcastItem : NSObject<NSSecureCoding>
|
||||
|
||||
Otherwise if the requirement is not met, the user is always prompted to install the update. In this case, the update is assumed to be a `majorUpgrade`.
|
||||
|
||||
If the update is a `majorUpgrade` and the update is skipped by the user, other future update alerts with the same `minimumAutoupdateVersion` will also be skipped.
|
||||
If the update is a `majorUpgrade` and the update is skipped by the user, other future update alerts with the same `minimumAutoupdateVersion` will also be skipped automatically unless an update specifies `ignoreSkippedUpgradesBelowVersion`.
|
||||
|
||||
This version string corresponds to the application's @c CFBundleVersion
|
||||
|
||||
This is extracted from the @c <sparkle:minimumAutoupdateVersion> element.
|
||||
*/
|
||||
@property (copy, readonly, nullable) NSString *minimumAutoupdateVersion;
|
||||
|
||||
@@ -278,6 +280,19 @@ SU_EXPORT @interface SUAppcastItem : NSObject<NSSecureCoding>
|
||||
*/
|
||||
@property (getter=isMajorUpgrade, readonly) BOOL majorUpgrade;
|
||||
|
||||
/**
|
||||
Previously skipped upgrades by the user will be ignored if they skipped an update whose version precedes this version.
|
||||
|
||||
This can only be applied if the update is a `majorUpgrade`.
|
||||
|
||||
This version string corresponds to the application's @c CFBundleVersion
|
||||
|
||||
This is extracted from the @c <sparkle:ignoreSkippedUpgradesBelowVersion> element.
|
||||
|
||||
Old applications must be using Sparkle 2.1 or later, otherwise this property will be ignored.
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *ignoreSkippedUpgradesBelowVersion;
|
||||
|
||||
/**
|
||||
Indicates whether or not the update item is critical.
|
||||
|
||||
|
||||
Vendored
+8
@@ -73,6 +73,7 @@ static NSString *SUAppcastItemStateKey = @"SUAppcastItemState";
|
||||
@synthesize propertiesDictionary = _propertiesDictionary;
|
||||
@synthesize installationType = _installationType;
|
||||
@synthesize minimumAutoupdateVersion = _minimumAutoupdateVersion;
|
||||
@synthesize ignoreSkippedUpgradesBelowVersion = _ignoreSkippedUpgradesBelowVersion;
|
||||
@synthesize phasedRolloutInterval = _phasedRolloutInterval;
|
||||
@synthesize state = _state;
|
||||
@synthesize hasCriticalInformation = _hasCriticalInformation;
|
||||
@@ -115,6 +116,7 @@ static NSString *SUAppcastItemStateKey = @"SUAppcastItemState";
|
||||
_maximumSystemVersion = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemMaximumSystemVersionKey] copy];
|
||||
_minimumSystemVersion = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemMinimumSystemVersionKey] copy];
|
||||
_minimumAutoupdateVersion = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastElementMinimumAutoupdateVersion] copy];
|
||||
_ignoreSkippedUpgradesBelowVersion = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastElementIgnoreSkippedUpgradesBelowVersion] copy];
|
||||
_releaseNotesURL = [decoder decodeObjectOfClass:[NSURL class] forKey:SUAppcastItemReleaseNotesURLKey];
|
||||
_fullReleaseNotesURL = [decoder decodeObjectOfClass:[NSURL class] forKey:SUAppcastItemFullReleaseNotesURLKey];
|
||||
_title = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemTitleKey] copy];
|
||||
@@ -183,6 +185,10 @@ static NSString *SUAppcastItemStateKey = @"SUAppcastItemState";
|
||||
[encoder encodeObject:self.minimumAutoupdateVersion forKey:SUAppcastElementMinimumAutoupdateVersion];
|
||||
}
|
||||
|
||||
if (self.ignoreSkippedUpgradesBelowVersion != nil) {
|
||||
[encoder encodeObject:self.ignoreSkippedUpgradesBelowVersion forKey:SUAppcastElementIgnoreSkippedUpgradesBelowVersion];
|
||||
}
|
||||
|
||||
if (self.state != nil) {
|
||||
[encoder encodeObject:self.state forKey:SUAppcastItemStateKey];
|
||||
}
|
||||
@@ -463,6 +469,8 @@ static NSString *SUAppcastItemStateKey = @"SUAppcastItemState";
|
||||
_maximumSystemVersion = [(NSString *)[dict objectForKey:SUAppcastElementMaximumSystemVersion] copy];
|
||||
_minimumAutoupdateVersion = [(NSString *)[dict objectForKey:SUAppcastElementMinimumAutoupdateVersion] copy];
|
||||
|
||||
_ignoreSkippedUpgradesBelowVersion = [(NSString *)[dict objectForKey:SUAppcastElementIgnoreSkippedUpgradesBelowVersion] copy];
|
||||
|
||||
NSString *channel = [dict objectForKey:SUAppcastElementChannel];
|
||||
if (channel != nil) {
|
||||
if (channel.length == 0) {
|
||||
|
||||
Vendored
+3
@@ -42,6 +42,7 @@ extern NSString *const SURelaunchHostBundleKey;
|
||||
extern NSString *const SUShowReleaseNotesKey;
|
||||
extern NSString *const SUSkippedMinorVersionKey;
|
||||
extern NSString *const SUSkippedMajorVersionKey;
|
||||
extern NSString *const SUSkippedMajorSubreleaseVersionKey;
|
||||
extern NSString *const SUScheduledCheckIntervalKey;
|
||||
extern NSString *const SULastCheckTimeKey;
|
||||
extern NSString *const SUExpectsDSASignatureKey;
|
||||
@@ -94,6 +95,8 @@ extern NSString *const SUAppcastElementTags;
|
||||
extern NSString *const SUAppcastElementPhasedRolloutInterval;
|
||||
extern NSString *const SUAppcastElementInformationalUpdate;
|
||||
extern NSString *const SUAppcastElementChannel;
|
||||
extern NSString *const SUAppcastElementBelowVersion;
|
||||
extern NSString *const SUAppcastElementIgnoreSkippedUpgradesBelowVersion;
|
||||
|
||||
extern NSString *const SURSSAttributeURL;
|
||||
extern NSString *const SURSSAttributeLength;
|
||||
|
||||
Vendored
+3
@@ -38,6 +38,7 @@ NSString *const SURelaunchHostBundleKey = @"SURelaunchHostBundle";
|
||||
NSString *const SUShowReleaseNotesKey = @"SUShowReleaseNotes";
|
||||
NSString *const SUSkippedMinorVersionKey = @"SUSkippedVersion";
|
||||
NSString *const SUSkippedMajorVersionKey = @"SUSkippedMajorVersion";
|
||||
NSString *const SUSkippedMajorSubreleaseVersionKey = @"SUSkippedMajorSubreleaseVersion";
|
||||
NSString *const SUScheduledCheckIntervalKey = @"SUScheduledCheckInterval";
|
||||
NSString *const SULastCheckTimeKey = @"SULastCheckTime";
|
||||
NSString *const SUExpectsDSASignatureKey = @"SUExpectsDSASignature";
|
||||
@@ -91,6 +92,8 @@ NSString *const SUAppcastElementTags = @"sparkle:tags";
|
||||
NSString *const SUAppcastElementPhasedRolloutInterval = @"sparkle:phasedRolloutInterval";
|
||||
NSString *const SUAppcastElementInformationalUpdate = @"sparkle:informationalUpdate";
|
||||
NSString *const SUAppcastElementChannel = @"sparkle:channel";
|
||||
NSString *const SUAppcastElementBelowVersion = @"sparkle:belowVersion";
|
||||
NSString *const SUAppcastElementIgnoreSkippedUpgradesBelowVersion = @"sparkle:ignoreSkippedUpgradesBelowVersion";
|
||||
|
||||
NSString *const SURSSAttributeURL = @"url";
|
||||
NSString *const SURSSAttributeLength = @"length";
|
||||
|
||||
Vendored
+1
-17
@@ -141,23 +141,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
|
||||
- (IBAction)skipThisVersion:(id)__unused sender
|
||||
{
|
||||
if (self.updateItem.majorUpgrade) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.alertStyle = NSAlertStyleInformational;
|
||||
alert.informativeText = SULocalizedString(@"Skipping this major upgrade will opt out of alerts for future updates.", nil);
|
||||
alert.messageText = SULocalizedString(@"Are you sure you want to skip this upgrade?", nil);
|
||||
|
||||
[alert addButtonWithTitle:SULocalizedString(@"Skip Upgrade", nil)];
|
||||
[alert addButtonWithTitle:SULocalizedString(@"Don't Skip", nil)];
|
||||
|
||||
[alert beginSheetModalForWindow:(NSWindow * _Nonnull)self.window completionHandler:^(NSModalResponse response) {
|
||||
if (response == NSAlertFirstButtonReturn) {
|
||||
[self endWithSelection:SPUUserUpdateChoiceSkip];
|
||||
}
|
||||
}];
|
||||
} else {
|
||||
[self endWithSelection:SPUUserUpdateChoiceSkip];
|
||||
}
|
||||
[self endWithSelection:SPUUserUpdateChoiceSkip];
|
||||
}
|
||||
|
||||
- (IBAction)remindMeLater:(id)__unused sender
|
||||
|
||||
Vendored
-3
@@ -155,9 +155,6 @@
|
||||
/* Skipping major upgrade */
|
||||
"Skip Upgrade" = "Update überspringen";
|
||||
|
||||
/* Confirmation message for skipping major upgrade and future updates */
|
||||
"Skipping this major upgrade will opt out of alerts for future updates." = "Wenn du dieses Hauptupdate überspringst, wirst du keine Hinweise für zukünftige Updates erhalten.";
|
||||
|
||||
/* (No Comment) */
|
||||
"The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version" = "Das Aktualisierungsprogramm wurde nicht richtig gestartet. Du solltest den App-Entwickler kontaktieren, um diesen Fehler zu melden und zu prüfen, ob du die neueste Version hast.";
|
||||
|
||||
|
||||
Vendored
-3
@@ -91,9 +91,6 @@
|
||||
/* Title confirmation for skipping major upgrade and future updates */
|
||||
"Are you sure you want to skip this upgrade?" = "このアップグレードをスキップしてもよろしいですか?";
|
||||
|
||||
/* Confirmation message for skipping major upgrade and future updates */
|
||||
"Skipping this major upgrade will opt out of alerts for future updates." = "このメジャーアップグレードをスキップすると、今後のアップデートも通知されなくなります。";
|
||||
|
||||
/* Skipping major upgrade */
|
||||
"Skip Upgrade" = "アップグレードをスキップ";
|
||||
|
||||
|
||||
Vendored
-3
@@ -155,9 +155,6 @@
|
||||
/* Skipping major upgrade */
|
||||
"Skip Upgrade" = "Sla update over";
|
||||
|
||||
/* Confirmation message for skipping major upgrade and future updates */
|
||||
"Skipping this major upgrade will opt out of alerts for future updates." = "Als je deze hoofdupdate overslaat, zul je geen meldingen voor toekomstige updates ontvangen.";
|
||||
|
||||
/* (No Comment) */
|
||||
"The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version" = "Het bijwerkprogramma is niet goed gestart. Je kunt wellicht met de app-ontwikkelaar contact opnemen om de fout te melden en te controleren dat je de nieuwste versie hebt";
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<sparkle:informationalUpdate>
|
||||
<sparkle:version>2.5</sparkle:version>
|
||||
<sparkle:version>2.4</sparkle:version>
|
||||
<sparkle:belowVersion>0.5</sparkle:belowVersion>
|
||||
</sparkle:informationalUpdate>
|
||||
<link>http://sparkle-project.org</link>
|
||||
</item>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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 4.1</title>
|
||||
<sparkle:version>4.1</sparkle:version>
|
||||
<sparkle:minimumAutoupdateVersion>4.0</sparkle:minimumAutoupdateVersion>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Version 4.0</title>
|
||||
<sparkle:version>4.0</sparkle:version>
|
||||
<sparkle:minimumAutoupdateVersion>4.0</sparkle:minimumAutoupdateVersion>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Version 3.9</title>
|
||||
<sparkle:version>3.9</sparkle:version>
|
||||
<sparkle:minimumAutoupdateVersion>3.0</sparkle:minimumAutoupdateVersion>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Version 3.0</title>
|
||||
<sparkle:version>3.0</sparkle:version>
|
||||
<sparkle:minimumAutoupdateVersion>3.0</sparkle:minimumAutoupdateVersion>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Version 2.0</title>
|
||||
<sparkle:version>2.0</sparkle:version>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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 4.1</title>
|
||||
<sparkle:version>4.1</sparkle:version>
|
||||
<sparkle:minimumAutoupdateVersion>4.0</sparkle:minimumAutoupdateVersion>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Version 4.0</title>
|
||||
<sparkle:version>4.0</sparkle:version>
|
||||
<sparkle:minimumAutoupdateVersion>4.0</sparkle:minimumAutoupdateVersion>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Version 3.9</title>
|
||||
<sparkle:version>3.9</sparkle:version>
|
||||
<sparkle:minimumAutoupdateVersion>3.0</sparkle:minimumAutoupdateVersion>
|
||||
<sparkle:ignoreSkippedUpgradesBelowVersion>3.5</sparkle:ignoreSkippedUpgradesBelowVersion>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Version 3.0</title>
|
||||
<sparkle:version>3.0</sparkle:version>
|
||||
<sparkle:minimumAutoupdateVersion>3.0</sparkle:minimumAutoupdateVersion>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Version 2.0</title>
|
||||
<!-- this should have no effect because there is no minimumAutoupdateVersion -->
|
||||
<sparkle:ignoreSkippedUpgradesBelowVersion>2.0</sparkle:ignoreSkippedUpgradesBelowVersion>
|
||||
<sparkle:version>2.0</sparkle:version>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" length="1346234" />
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
+269
-9
@@ -205,6 +205,16 @@ class SUAppcastTest: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
// Test informational updates from version 2.3
|
||||
do {
|
||||
let hostVersion = "2.3"
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
XCTAssertFalse(appcast.items[1].isInformationOnlyUpdate)
|
||||
}
|
||||
|
||||
// Test informational updates from version 2.4
|
||||
do {
|
||||
let hostVersion = "2.4"
|
||||
@@ -235,6 +245,36 @@ class SUAppcastTest: XCTestCase {
|
||||
XCTAssertFalse(appcast.items[1].isInformationOnlyUpdate)
|
||||
}
|
||||
|
||||
// Test informational updates from version 0.5
|
||||
do {
|
||||
let hostVersion = "0.5"
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
XCTAssertFalse(appcast.items[1].isInformationOnlyUpdate)
|
||||
}
|
||||
|
||||
// Test informational updates from version 0.4
|
||||
do {
|
||||
let hostVersion = "0.4"
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
XCTAssertTrue(appcast.items[1].isInformationOnlyUpdate)
|
||||
}
|
||||
|
||||
// Test informational updates from version 0.0
|
||||
do {
|
||||
let hostVersion = "0.0"
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
XCTAssertTrue(appcast.items[1].isInformationOnlyUpdate)
|
||||
}
|
||||
|
||||
} catch let err as NSError {
|
||||
NSLog("%@", err)
|
||||
XCTFail(err.localizedDescription)
|
||||
@@ -318,7 +358,7 @@ class SUAppcastTest: XCTestCase {
|
||||
|
||||
// There should be no items if 2.0 is skipped from 1.0 and 3.0 fails minimum autoupdate version
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.0", majorVersion: nil)
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.0", majorVersion: nil, majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: true)
|
||||
|
||||
@@ -327,7 +367,7 @@ class SUAppcastTest: XCTestCase {
|
||||
|
||||
// Try again but allowing minimum autoupdate version to fail
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.0", majorVersion: nil)
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.0", majorVersion: nil, majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
@@ -340,7 +380,7 @@ class SUAppcastTest: XCTestCase {
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip 3.0
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "3.0")
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "3.0", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
@@ -353,7 +393,7 @@ class SUAppcastTest: XCTestCase {
|
||||
|
||||
// Allow minimum autoupdate version to fail skipping both 2.0 and 3.0
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.0", majorVersion: "3.0")
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.0", majorVersion: "3.0", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
@@ -363,7 +403,7 @@ class SUAppcastTest: XCTestCase {
|
||||
// Allow minimum autoupdate version to fail and only skip "2.5"
|
||||
// This should implicitly only skip 2.0
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.5", majorVersion: nil)
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.5", majorVersion: nil, majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
@@ -376,7 +416,7 @@ class SUAppcastTest: XCTestCase {
|
||||
|
||||
// This should not skip anything but require passing minimum autoupdate version
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "1.5", majorVersion: nil)
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "1.5", majorVersion: nil, majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: true)
|
||||
|
||||
@@ -389,7 +429,7 @@ class SUAppcastTest: XCTestCase {
|
||||
|
||||
// This should not skip anything but allow failing minimum autoupdate version
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "1.5", majorVersion: nil)
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "1.5", majorVersion: nil, majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
@@ -402,7 +442,7 @@ class SUAppcastTest: XCTestCase {
|
||||
|
||||
// This should not skip anything but require passing minimum autoupdate version
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "1.5", majorVersion: "1.0")
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "1.5", majorVersion: "1.0", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: true)
|
||||
|
||||
@@ -415,7 +455,7 @@ class SUAppcastTest: XCTestCase {
|
||||
|
||||
// This should not skip anything but allow failing minimum autoupdate version
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "1.5", majorVersion: "1.0")
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "1.5", majorVersion: "1.0", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
@@ -432,6 +472,226 @@ class SUAppcastTest: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
func testMinimumAutoupdateVersionAdvancedSkipping() {
|
||||
let testURL = Bundle(for: SUAppcastTest.self).url(forResource: "testappcast_minimumAutoupdateVersionSkipping", withExtension: "xml")!
|
||||
|
||||
do {
|
||||
let testData = try Data(contentsOf: testURL)
|
||||
|
||||
let versionComparator = SUStandardVersionComparator()
|
||||
|
||||
do {
|
||||
// Test appcast without a filter
|
||||
|
||||
let hostVersion = "1.0"
|
||||
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
XCTAssertEqual(5, appcast.items.count)
|
||||
}
|
||||
|
||||
let currentDate = Date()
|
||||
// Because 3.0 has minimum autoupdate version of 3.0, and 4.0 has minimum autoupdate version of 4.0, we should be offered 2.0
|
||||
do {
|
||||
let hostVersion = "1.0"
|
||||
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: nil, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: true)
|
||||
|
||||
XCTAssertEqual(1, supportedAppcast.items.count)
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "2.0")
|
||||
}
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip major version "3.0"
|
||||
// This should skip all 3.x versions, but not 4.x versions nor 2.x versions
|
||||
do {
|
||||
let hostVersion = "1.0"
|
||||
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "3.0", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
XCTAssertEqual(3, supportedAppcast.items.count)
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "4.1")
|
||||
}
|
||||
|
||||
// Allow minimum autoupdate version to pass and only skip major version "3.0"
|
||||
// This should only return back the latest minor version available
|
||||
do {
|
||||
let hostVersion = "1.0"
|
||||
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "3.0", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: true)
|
||||
|
||||
XCTAssertEqual(1, supportedAppcast.items.count)
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "2.0")
|
||||
}
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip major version "4.0"
|
||||
// This should skip all 3.x versions and 4.x versions but not 2.x versions
|
||||
do {
|
||||
let hostVersion = "1.0"
|
||||
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "4.0", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
XCTAssertEqual(1, supportedAppcast.items.count)
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "2.0")
|
||||
}
|
||||
} catch let err as NSError {
|
||||
NSLog("%@", err)
|
||||
XCTFail(err.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
func testMinimumAutoupdateVersionIgnoringSkipping() {
|
||||
let testURL = Bundle(for: SUAppcastTest.self).url(forResource: "testappcast_minimumAutoupdateVersionSkipping2", withExtension: "xml")!
|
||||
|
||||
do {
|
||||
let testData = try Data(contentsOf: testURL)
|
||||
|
||||
let versionComparator = SUStandardVersionComparator()
|
||||
|
||||
let currentDate = Date()
|
||||
|
||||
do {
|
||||
let hostVersion = "1.0"
|
||||
|
||||
let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
|
||||
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver)
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip major version "3.0" with no subrelease version
|
||||
// This should skip all 3.x versions except for 3.9 which ignores skipped upgrades below 3.5, but not 4.x versions nor 2.x versions
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "3.0", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
XCTAssertEqual(4, supportedAppcast.items.count)
|
||||
|
||||
XCTAssertEqual(supportedAppcast.items[0].versionString, "4.1")
|
||||
XCTAssertEqual(supportedAppcast.items[1].versionString, "4.0")
|
||||
XCTAssertEqual(supportedAppcast.items[2].versionString, "3.9")
|
||||
XCTAssertEqual(supportedAppcast.items[3].versionString, "2.0")
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "4.1")
|
||||
}
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip major version "3.0" with subrelease version 3.4
|
||||
// This should skip all 3.x versions except for 3.9 which ignores skipped upgrades below 3.5, but not 4.x versions nor 2.x versions
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "3.4", majorSubreleaseVersion: nil)
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
XCTAssertEqual(4, supportedAppcast.items.count)
|
||||
|
||||
XCTAssertEqual(supportedAppcast.items[0].versionString, "4.1")
|
||||
XCTAssertEqual(supportedAppcast.items[1].versionString, "4.0")
|
||||
XCTAssertEqual(supportedAppcast.items[2].versionString, "3.9")
|
||||
XCTAssertEqual(supportedAppcast.items[3].versionString, "2.0")
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "4.1")
|
||||
}
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip major version "3.0" with subrelease version 3.5
|
||||
// This should skip all 3.x versions, but not 4.x versions nor 2.x versions
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "3.0", majorSubreleaseVersion: "3.5")
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
XCTAssertEqual(3, supportedAppcast.items.count)
|
||||
|
||||
XCTAssertEqual(supportedAppcast.items[0].versionString, "4.1")
|
||||
XCTAssertEqual(supportedAppcast.items[1].versionString, "4.0")
|
||||
XCTAssertEqual(supportedAppcast.items[2].versionString, "2.0")
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "4.1")
|
||||
}
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip major version "3.0" with subrelease version 3.5.1
|
||||
// This should skip all 3.x versions, but not 4.x versions nor 2.x versions
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "3.0", majorSubreleaseVersion: "3.5.1")
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
XCTAssertEqual(3, supportedAppcast.items.count)
|
||||
|
||||
XCTAssertEqual(supportedAppcast.items[0].versionString, "4.1")
|
||||
XCTAssertEqual(supportedAppcast.items[1].versionString, "4.0")
|
||||
XCTAssertEqual(supportedAppcast.items[2].versionString, "2.0")
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "4.1")
|
||||
}
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip major version "4.0" with subrelease version 4.0
|
||||
// This should skip all 3.x versions and 4.x versions, but not 2.x versions
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: nil, majorVersion: "4.0", majorSubreleaseVersion: "4.0")
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
XCTAssertEqual(1, supportedAppcast.items.count)
|
||||
|
||||
XCTAssertEqual(supportedAppcast.items[0].versionString, "2.0")
|
||||
|
||||
let bestAppcastItem = SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcast.items, getDeltaItem: nil, withHostVersion: hostVersion, comparator: versionComparator)
|
||||
|
||||
XCTAssertEqual(bestAppcastItem.versionString, "2.0")
|
||||
}
|
||||
|
||||
// Allow minimum autoupdate version to fail and only skip major version "4.0" with subrelease version 4.0, and skip minor version 2.1
|
||||
// This should skip everything
|
||||
do {
|
||||
let skippedUpdate = SPUSkippedUpdate(minorVersion: "2.1", majorVersion: "4.0", majorSubreleaseVersion: "4.0")
|
||||
|
||||
let supportedAppcast = SUAppcastDriver.filterSupportedAppcast(appcast, phasedUpdateGroup: nil, skippedUpdate: skippedUpdate, currentDate: currentDate, hostVersion: hostVersion, versionComparator: versionComparator, testOSVersion: true, testMinimumAutoupdateVersion: false)
|
||||
|
||||
XCTAssertEqual(0, supportedAppcast.items.count)
|
||||
}
|
||||
}
|
||||
} catch let err as NSError {
|
||||
NSLog("%@", err)
|
||||
XCTFail(err.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
func testPhasedGroupRollouts() {
|
||||
let testURL = Bundle(for: SUAppcastTest.self).url(forResource: "testappcast_phasedRollout", withExtension: "xml")!
|
||||
|
||||
|
||||
@@ -1012,6 +1012,118 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testFileSystemCompression
|
||||
{
|
||||
[self createAndApplyPatchWithBeforeDiffHandler:^(NSFileManager *__unused fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
|
||||
NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"];
|
||||
NSString *destinationFile = [destinationDirectory stringByAppendingPathComponent:@"A"];
|
||||
NSString *destinationFile2 = [destinationDirectory stringByAppendingPathComponent:@"A2"];
|
||||
|
||||
XCTAssertTrue([[self bigData1] writeToFile:sourceFile atomically:YES]);
|
||||
XCTAssertTrue([[self bigData2] writeToFile:destinationFile atomically:YES]);
|
||||
|
||||
{
|
||||
// We only track executable files to decide if we want to apply file system compression over the entire bundle
|
||||
int lchmodResult = lchmod(destinationFile.fileSystemRepresentation, 0755);
|
||||
XCTAssertEqual(lchmodResult, 0);
|
||||
}
|
||||
|
||||
NSTask *dittoTask = [[NSTask alloc] init];
|
||||
|
||||
if (@available(macOS 10.13, *)) {
|
||||
dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO];
|
||||
} else {
|
||||
dittoTask.launchPath = @"/usr/bin/ditto";
|
||||
}
|
||||
|
||||
dittoTask.arguments = @[@"--hfsCompression", destinationFile, destinationFile2];
|
||||
|
||||
NSError *launchError = nil;
|
||||
if (@available(macOS 10.13, *)) {
|
||||
BOOL launched = [dittoTask launchAndReturnError:&launchError];
|
||||
if (!launched) {
|
||||
XCTFail(@"Failed to launch ditto: %@", launchError);
|
||||
}
|
||||
} else {
|
||||
[dittoTask launch];
|
||||
}
|
||||
[dittoTask waitUntilExit];
|
||||
|
||||
XCTAssertEqual(dittoTask.terminationStatus, 0);
|
||||
|
||||
XCTAssertFalse([self testDirectoryHashEqualityWithSource:sourceDirectory destination:destinationDirectory]);
|
||||
} afterDiffHandler:nil afterPatchHandler:^(NSFileManager *__unused fileManager, NSString *__unused sourceDirectory, NSString *destinationDirectory) {
|
||||
|
||||
NSString *destinationFile = [destinationDirectory stringByAppendingPathComponent:@"A"];
|
||||
NSString *destinationFile2 = [destinationDirectory stringByAppendingPathComponent:@"A2"];
|
||||
|
||||
// Both files should have file system compression applied
|
||||
{
|
||||
struct stat statStruct = {0};
|
||||
int result = lstat(destinationFile.fileSystemRepresentation, &statStruct);
|
||||
XCTAssertEqual(result, 0);
|
||||
|
||||
if ((statStruct.st_flags & UF_COMPRESSED) == 0) {
|
||||
XCTFail(@"First destination file is not compressed!");
|
||||
}
|
||||
}
|
||||
{
|
||||
struct stat statStruct = {0};
|
||||
int result = lstat(destinationFile2.fileSystemRepresentation, &statStruct);
|
||||
XCTAssertEqual(result, 0);
|
||||
|
||||
if ((statStruct.st_flags & UF_COMPRESSED) == 0) {
|
||||
XCTFail(@"Second destination file is not compressed!");
|
||||
}
|
||||
}
|
||||
} testingVersion2Delta:NO];
|
||||
}
|
||||
|
||||
- (void)testNoFileSystemCompression
|
||||
{
|
||||
[self createAndApplyPatchWithBeforeDiffHandler:^(NSFileManager *__unused fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
|
||||
NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"];
|
||||
NSString *destinationFile = [destinationDirectory stringByAppendingPathComponent:@"A"];
|
||||
NSString *destinationFile2 = [destinationDirectory stringByAppendingPathComponent:@"A2"];
|
||||
|
||||
XCTAssertTrue([[self bigData1] writeToFile:sourceFile atomically:YES]);
|
||||
XCTAssertTrue([[self bigData2] writeToFile:destinationFile atomically:YES]);
|
||||
XCTAssertTrue([[self bigData2] writeToFile:destinationFile2 atomically:YES]);
|
||||
|
||||
{
|
||||
// We only usually track executable files to decide if we want to apply file system compression over the entire bundle
|
||||
int lchmodResult = lchmod(destinationFile.fileSystemRepresentation, 0755);
|
||||
XCTAssertEqual(lchmodResult, 0);
|
||||
}
|
||||
|
||||
XCTAssertFalse([self testDirectoryHashEqualityWithSource:sourceDirectory destination:destinationDirectory]);
|
||||
} afterDiffHandler:nil afterPatchHandler:^(NSFileManager *__unused fileManager, NSString *__unused sourceDirectory, NSString *destinationDirectory) {
|
||||
|
||||
NSString *destinationFile = [destinationDirectory stringByAppendingPathComponent:@"A"];
|
||||
NSString *destinationFile2 = [destinationDirectory stringByAppendingPathComponent:@"A2"];
|
||||
|
||||
// Both files should not have file system compression applied
|
||||
{
|
||||
struct stat statStruct = {0};
|
||||
int result = lstat(destinationFile.fileSystemRepresentation, &statStruct);
|
||||
XCTAssertEqual(result, 0);
|
||||
|
||||
if ((statStruct.st_flags & UF_COMPRESSED) != 0) {
|
||||
XCTFail(@"First destination file is compressed!");
|
||||
}
|
||||
}
|
||||
{
|
||||
struct stat statStruct = {0};
|
||||
int result = lstat(destinationFile2.fileSystemRepresentation, &statStruct);
|
||||
XCTAssertEqual(result, 0);
|
||||
|
||||
if ((statStruct.st_flags & UF_COMPRESSED) != 0) {
|
||||
XCTFail(@"Second destination file is compressed!");
|
||||
}
|
||||
}
|
||||
} testingVersion2Delta:NO];
|
||||
}
|
||||
|
||||
- (void)testFrameworkVersionChanged
|
||||
{
|
||||
[self createAndApplyPatchWithHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
|
||||
|
||||
@@ -49,7 +49,7 @@ func extractVersion(parent: XMLNode) -> String? {
|
||||
return nil
|
||||
}
|
||||
|
||||
func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem], newVersions: Set<String>?, maxNewVersionsInFeed: Int, fullReleaseNotesLink: String?, maxCDATAThreshold: Int, link: String?, newChannel: String?, majorVersion: String?, phasedRolloutInterval: Int?, criticalUpdateVersion: String?, informationalUpdateVersions: [String]?) throws -> (numNewUpdates: Int, numExistingUpdates: Int) {
|
||||
func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem], newVersions: Set<String>?, maxNewVersionsInFeed: Int, fullReleaseNotesLink: String?, maxCDATAThreshold: Int, link: String?, newChannel: String?, majorVersion: String?, ignoreSkippedUpgradesBelowVersion: String?, phasedRolloutInterval: Int?, criticalUpdateVersion: String?, informationalUpdateVersions: [String]?) throws -> (numNewUpdates: Int, numExistingUpdates: Int) {
|
||||
let appBaseName = updates[0].appPath.deletingPathExtension().lastPathComponent
|
||||
|
||||
let sparkleNS = "http://www.andymatuschak.org/xml-namespaces/sparkle"
|
||||
@@ -188,6 +188,12 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem], newVersions: Set
|
||||
item.addChild(minimumAutoupdateVersionElement)
|
||||
}
|
||||
|
||||
// Set ignore skipped upgrades below version
|
||||
if let ignoreSkippedUpgradesBelowVersion = ignoreSkippedUpgradesBelowVersion, let ignoreSkippedUpgradesBelowVersionElement = XMLElement.element(withName: SUAppcastElementIgnoreSkippedUpgradesBelowVersion, uri: sparkleNS) as? XMLElement {
|
||||
ignoreSkippedUpgradesBelowVersionElement.setChildren([text(ignoreSkippedUpgradesBelowVersion)])
|
||||
item.addChild(ignoreSkippedUpgradesBelowVersionElement)
|
||||
}
|
||||
|
||||
// Set phased rollout interval
|
||||
if let phasedRolloutInterval = phasedRolloutInterval,
|
||||
let phasedRolloutIntervalElement = XMLElement.element(withName: SUAppcastElementPhasedRolloutInterval, uri: sparkleNS) as? XMLElement {
|
||||
@@ -208,8 +214,17 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem], newVersions: Set
|
||||
if let informationalUpdateVersions = informationalUpdateVersions,
|
||||
let informationalUpdateElement = XMLElement.element(withName: SUAppcastElementInformationalUpdate, uri: sparkleNS) as? XMLElement {
|
||||
let versionElements: [XMLElement] = informationalUpdateVersions.compactMap({ informationalUpdateVersion in
|
||||
let element = XMLElement.element(withName: SUAppcastAttributeVersion, uri: sparkleNS) as? XMLElement
|
||||
element?.setChildren([text(informationalUpdateVersion)])
|
||||
let element: XMLElement?
|
||||
let informationalVersionText: String
|
||||
if informationalUpdateVersion.hasPrefix("<") {
|
||||
element = XMLElement.element(withName: SUAppcastElementBelowVersion, uri: sparkleNS) as? XMLElement
|
||||
informationalVersionText = String(informationalUpdateVersion.dropFirst())
|
||||
} else {
|
||||
element = XMLElement.element(withName: SUAppcastElementVersion, uri: sparkleNS) as? XMLElement
|
||||
informationalVersionText = informationalUpdateVersion
|
||||
}
|
||||
|
||||
element?.setChildren([text(informationalVersionText)])
|
||||
return element
|
||||
})
|
||||
|
||||
|
||||
@@ -101,13 +101,16 @@ struct GenerateAppcast: ParsableCommand {
|
||||
@Option(name: .long, help: ArgumentHelp("The last major or minimum autoupdate sparkle:version that will be used for generating new updates. By default, no last major version is used.", valueName: "major-version"))
|
||||
var majorVersion: String?
|
||||
|
||||
@Option(name: .long, help: ArgumentHelp("Ignore skipped major upgrades below this specified version. Only applicable for major upgrades.", valueName: "below-version"))
|
||||
var ignoreSkippedUpgradesBelowVersion: String?
|
||||
|
||||
@Option(name: .long, help: ArgumentHelp("The phased rollout interval in seconds that will be used for generating new updates. By default, no phased rollout interval is used.", valueName: "phased-rollout-interval"), transform: { Int($0) })
|
||||
var phasedRolloutInterval: Int?
|
||||
|
||||
@Option(name: .long, help: ArgumentHelp("The last critical update sparkle:version that will be used for generating new updates. An empty string argument will treat this update as critical coming from any application version. By default, no last critical update version is used. Old applications need to be using Sparkle 2 to use this feature.", valueName: "critical-update-version"))
|
||||
var criticalUpdateVersion: String?
|
||||
|
||||
@Option(name: .long, help: ArgumentHelp("A comma delimited list of application sparkle:version's that will see newly generated updates as being informational only. An empty string argument will treat this update as informational coming from any application version. By default, updates are not informational only. --link must also be provided. Old applications need to be using Sparkle 2 to use this feature.", valueName: "informational-update-versions"), transform: { $0.components(separatedBy: ",").filter({$0.count > 0}) })
|
||||
@Option(name: .long, help: ArgumentHelp("A comma delimited list of application sparkle:version's that will see newly generated updates as being informational only. An empty string argument will treat this update as informational coming from any application version. Prefix a version string with '<' to indicate (eg \"<2.5\") to indicate older versions than the one specified should treat the update as informational only. By default, updates are not informational only. --link must also be provided. Old applications need to be using Sparkle 2 to use this feature, and 2.1 or later to use the '<' upper bound feature.", valueName: "informational-update-versions"), transform: { $0.components(separatedBy: ",").filter({$0.count > 0}) })
|
||||
var informationalUpdateVersions: [String]?
|
||||
|
||||
@Option(name: .customShort("o"), help: ArgumentHelp("Path to filename for the generated appcast (allowed when only one will be created).", valueName: "output-path"), transform: { URL(fileURLWithPath: $0) })
|
||||
@@ -251,7 +254,7 @@ struct GenerateAppcast: ParsableCommand {
|
||||
relativeTo: archivesSourceDir)
|
||||
|
||||
// Write the appcast
|
||||
let (numNewUpdates, numExistingUpdates) = try writeAppcast(appcastDestPath: appcastDestPath, updates: updates, newVersions: versions, maxNewVersionsInFeed: maxNewVersionsInFeed, fullReleaseNotesLink: fullReleaseNotesURL, maxCDATAThreshold: maxCDATAThreshold, link: link, newChannel: channel, majorVersion: majorVersion, phasedRolloutInterval: phasedRolloutInterval, criticalUpdateVersion: criticalUpdateVersion, informationalUpdateVersions: informationalUpdateVersions)
|
||||
let (numNewUpdates, numExistingUpdates) = try writeAppcast(appcastDestPath: appcastDestPath, updates: updates, newVersions: versions, maxNewVersionsInFeed: maxNewVersionsInFeed, fullReleaseNotesLink: fullReleaseNotesURL, maxCDATAThreshold: maxCDATAThreshold, link: link, newChannel: channel, majorVersion: majorVersion, ignoreSkippedUpgradesBelowVersion: ignoreSkippedUpgradesBelowVersion, phasedRolloutInterval: phasedRolloutInterval, criticalUpdateVersion: criticalUpdateVersion, informationalUpdateVersions: informationalUpdateVersions)
|
||||
|
||||
// Inform the user, pluralizing "update" if necessary
|
||||
let pluralizeUpdates = { $0 == 1 ? "update" : "updates" }
|
||||
|
||||
Reference in new issue
Block a user