mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-23 04:34:27 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea94969188 | ||
|
|
57731f44d7 | ||
|
|
2a0514c93b | ||
|
|
467e1495c0 | ||
|
|
8ac254951a | ||
|
|
c83c9221f7 | ||
|
|
b46315df9c | ||
|
|
9c505dee2f | ||
|
|
2ed7402367 | ||
|
|
3afa47b092 |
No files matched your search
@@ -1,3 +1,15 @@
|
||||
# 1.19.0
|
||||
|
||||
* Refactoring of downloader code to avoid deprecated methods (Deadpikle)
|
||||
* Changes to which methods run on the main thread.
|
||||
Note: some delegate methods may be called on non-main thread now. (Kornel)
|
||||
* Update Japanese localization (1024jp)
|
||||
* Update Sparkle.strings (Stefan Paychère)
|
||||
* Fix Sparkle clients polling too frequently (Jonathan Bullard)
|
||||
* Handle SecTransformExecute errors (Kornel)
|
||||
* Silence Touch Bar availability warnings on Xcode 9 by using API_AVAILABLE. Disable gnu-zero-variadic-macro-arguments to prevent warnings from use of API_AVAILABLE. (Kent Sutherland)
|
||||
* 10.11 SDK compatibility (David Fuhrmann)
|
||||
|
||||
# 1.18.1
|
||||
|
||||
* Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115) (App Tyrant)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
.PHONY: all localizable-strings release build test ci
|
||||
|
||||
all: build
|
||||
|
||||
ifndef BUILDDIR
|
||||
BUILDDIR := $(shell mktemp -d "$(TMPDIR)/Sparkle.XXXXXX")
|
||||
endif
|
||||
|
||||
Vendored
+1
-1
@@ -41,7 +41,7 @@ static NSTimeInterval OLD_ITEM_DELETION_INTERVAL = 86400 * 10; // 10 days
|
||||
NSDictionary<NSString *, id> *fileAttributes = [fileManager attributesOfItemAtPath:[directory stringByAppendingPathComponent:filename] error:NULL];
|
||||
if (fileAttributes != nil)
|
||||
{
|
||||
NSDate *lastModificationDate = fileAttributes[NSFileModificationDate];
|
||||
NSDate *lastModificationDate = [fileAttributes objectForKey:NSFileModificationDate];
|
||||
if ([currentDate timeIntervalSinceDate:lastModificationDate] >= OLD_ITEM_DELETION_INTERVAL)
|
||||
{
|
||||
[filePathsToRemove addObject:[directory stringByAppendingPathComponent:filename]];
|
||||
|
||||
Vendored
+11
-7
@@ -72,13 +72,17 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
NSURL *url = [decoder decodeObjectOfClass:[NSURL class] forKey:SPUURLRequestURLKey];
|
||||
NSURLRequestCachePolicy cachePolicy = (NSURLRequestCachePolicy)[decoder decodeIntegerForKey:SPUURLRequestCachePolicyKey];
|
||||
NSTimeInterval timeoutInterval = [decoder decodeDoubleForKey:SPUURLRequestTimeoutIntervalKey];
|
||||
NSDictionary<NSString *, NSString *> *httpHeaderFields = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class]]] forKey:SPUURLRequestHttpHeaderFieldsKey];
|
||||
NSURLRequestNetworkServiceType networkServiceType = (NSURLRequestNetworkServiceType)[decoder decodeIntegerForKey:SPUURLRequestNetworkServiceTypeKey];
|
||||
|
||||
return [self initWithURL:url cachePolicy:cachePolicy timeoutInterval:timeoutInterval httpHeaderFields:httpHeaderFields networkServiceType:networkServiceType];
|
||||
if (@available(macOS 10.8, *)) {
|
||||
NSURL *url = [decoder decodeObjectOfClass:[NSURL class] forKey:SPUURLRequestURLKey];
|
||||
NSURLRequestCachePolicy cachePolicy = (NSURLRequestCachePolicy)[decoder decodeIntegerForKey:SPUURLRequestCachePolicyKey];
|
||||
NSTimeInterval timeoutInterval = [decoder decodeDoubleForKey:SPUURLRequestTimeoutIntervalKey];
|
||||
NSDictionary<NSString *, NSString *> *httpHeaderFields = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class]]] forKey:SPUURLRequestHttpHeaderFieldsKey];
|
||||
NSURLRequestNetworkServiceType networkServiceType = (NSURLRequestNetworkServiceType)[decoder decodeIntegerForKey:SPUURLRequestNetworkServiceTypeKey];
|
||||
|
||||
return [self initWithURL:url cachePolicy:cachePolicy timeoutInterval:timeoutInterval httpHeaderFields:httpHeaderFields networkServiceType:networkServiceType];
|
||||
} else {
|
||||
abort(); // Not used on 10.7
|
||||
}
|
||||
}
|
||||
|
||||
- (NSURLRequest *)request
|
||||
|
||||
Vendored
+7
-2
@@ -304,7 +304,7 @@
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
void (^callback)() = ^{
|
||||
if (self.showErrors) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.messageText = SULocalizedString(@"Update Error!", nil);
|
||||
@@ -313,7 +313,12 @@
|
||||
[self showAlert:alert];
|
||||
}
|
||||
[super abortUpdateWithError:error];
|
||||
});
|
||||
};
|
||||
if ([NSThread isMainThread]) {
|
||||
callback();
|
||||
} else {
|
||||
dispatch_sync(dispatch_get_main_queue(), callback);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)abortUpdate
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Möchtest du %1$@ jetzt durch die neue Version ersetzen und neu starten?";
|
||||
|
||||
"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ kann nicht aktualisiert werden, weil es von einem Ort ohne Schreibzugriff oder temporären Ort aus gestartet wurde. Kopiere %1$@ in den Programmeordner, starte es von dort aus und versuche es erneut zu aktualisieren.";
|
||||
"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ kann nicht aktualisiert werden, da es aus dem Downloads-Order, oder von einer DMG Datei oder Laufwerk ohne Schreibzugriff gestartet wurde. Kopiere %1$@ in den Programmeordner, starte es von dort aus und versuche es erneut zu aktualisieren.";
|
||||
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ ist zurzeit die neueste verfügbare Version.";
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?";
|
||||
|
||||
"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ can’t be updated when it’s running from a read-only volume like a disk image or an optical drive. Move %1$@ to Applications folder using Finder, relaunch it from there, and try again.";
|
||||
"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.";
|
||||
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -86,4 +86,4 @@
|
||||
"You already have the newest version of %@." = "Você já possui a versão mais recente do %@.";
|
||||
|
||||
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
|
||||
"You're up-to-date!" = "Você está atualizado!";
|
||||
"You're up-to-date!" = "O app está atualizado!";
|
||||
@@ -14,10 +14,10 @@ func makeError(code: SUError, _ description: String) -> NSError {
|
||||
]);
|
||||
}
|
||||
|
||||
func makeAppcast(archivesSourceDir: URL, privateKey: SecKey) throws -> [String:[ArchiveItem]] {
|
||||
func makeAppcast(archivesSourceDir: URL, privateKey: SecKey, verbose: Bool) throws -> [String:[ArchiveItem]] {
|
||||
let comparator = SUStandardVersionComparator();
|
||||
|
||||
let allUpdates = (try unarchiveUpdates(archivesSourceDir: archivesSourceDir))
|
||||
let allUpdates = (try unarchiveUpdates(archivesSourceDir: archivesSourceDir, verbose:verbose))
|
||||
.sorted(by: {
|
||||
.orderedDescending == comparator.compareVersion($0.version, toVersion:$1.version)
|
||||
})
|
||||
@@ -85,7 +85,6 @@ func makeAppcast(archivesSourceDir: URL, privateKey: SecKey) throws -> [String:[
|
||||
|
||||
// Require delta to be a bit smaller
|
||||
if delta.fileSize / 7 < latestItem.fileSize / 8 {
|
||||
// Max 3 deltas per version (arbitrary limit to reduce amount of work)
|
||||
numDeltas += 1;
|
||||
if numDeltas > maxDeltas {
|
||||
break;
|
||||
|
||||
@@ -39,8 +39,11 @@ func unarchive(itemPath:URL, archiveDestDir: URL, callback: @escaping (Error?) -
|
||||
}
|
||||
}
|
||||
|
||||
func unarchiveUpdates(archivesSourceDir: URL) throws -> [ArchiveItem] {
|
||||
func unarchiveUpdates(archivesSourceDir: URL, verbose: Bool) throws -> [ArchiveItem] {
|
||||
let archivesDestDir = archivesSourceDir.appendingPathComponent(".tmp");
|
||||
if verbose {
|
||||
print("Unarchiving to temp directory", archivesDestDir.path);
|
||||
}
|
||||
|
||||
let group = DispatchGroup();
|
||||
|
||||
@@ -60,10 +63,18 @@ func unarchiveUpdates(archivesSourceDir: URL) throws -> [ArchiveItem] {
|
||||
}
|
||||
|
||||
let addItem = {
|
||||
if let item = try? ArchiveItem(fromArchive: itemPath, unarchivedDir: archiveDestDir) {
|
||||
do {
|
||||
let item = try ArchiveItem(fromArchive: itemPath, unarchivedDir: archiveDestDir);
|
||||
if verbose {
|
||||
print("Found archive", item);
|
||||
}
|
||||
objc_sync_enter(unarchived);
|
||||
unarchived.append(item);
|
||||
objc_sync_exit(unarchived);
|
||||
} catch {
|
||||
if verbose {
|
||||
print("Skipped", item, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
var verbose = false;
|
||||
|
||||
func main() {
|
||||
let args = CommandLine.arguments;
|
||||
if args.count < 3 {
|
||||
@@ -26,7 +28,7 @@ func main() {
|
||||
do {
|
||||
let privateKey = try loadPrivateKey(privateKeyPath: privateKeyPath);
|
||||
do {
|
||||
let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, privateKey: privateKey);
|
||||
let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, privateKey: privateKey, verbose:verbose);
|
||||
|
||||
for (appcastFile, updates) in allUpdates {
|
||||
let appcastDestPath = URL(fileURLWithPath: appcastFile, relativeTo: archivesSourceDir);
|
||||
|
||||
Reference in new issue
Block a user