Merge branch 'master' into ui-separation-and-xpc

This commit is contained in:
Zorg committed 2016-04-20 00:05:45 -04:00
commit 7183d9ebc5
4 files changed
+12 -16

No files matched your search

+2 -1
View File
@@ -47,6 +47,7 @@
// If we support sandboxing this component in the future, it is important to note this may return a different path
// For this reason, this method should not be a part of SUHost because its behavior depends on what kind of process it's being invoked from
#warning kind of duplicated code from SUUpdateDownloader ??
+ (NSString *)sparkleCachePathForHost:(SUHost *)host
{
NSArray *cachePaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
@@ -65,7 +66,7 @@
}
cachePath = [cachePath stringByAppendingPathComponent:name];
cachePath = [cachePath stringByAppendingPathComponent:@"Sparkle"];
cachePath = [cachePath stringByAppendingPathComponent:@SPARKLE_BUNDLE_IDENTIFIER];
return cachePath;
}
+1 -1
View File
@@ -63,7 +63,7 @@ static NSString * const UPDATED_VERSION = @"2.0";
assert(bundleIdentifier != nil);
// Create a directory that'll be used for our web server listing
NSURL *serverDirectoryURL = [cacheDirectoryURL URLByAppendingPathComponent:bundleIdentifier];
NSURL *serverDirectoryURL = [[cacheDirectoryURL URLByAppendingPathComponent:bundleIdentifier] URLByAppendingPathComponent:@"ServerData"];
if ([serverDirectoryURL checkResourceIsReachableAndReturnError:nil]) {
NSError *removeServerDirectoryError = nil;
+2 -7
View File
@@ -68,13 +68,8 @@
[super tearDown];
if (self.notSignedAppPath) {
[[NSFileManager defaultManager] removeItemAtPath:self.notSignedAppPath error:nil];
}
if (self.validSignedAppPath) {
[[NSFileManager defaultManager] removeItemAtPath:self.validSignedAppPath error:nil];
}
if (self.invalidSignedAppPath) {
[[NSFileManager defaultManager] removeItemAtPath:self.invalidSignedAppPath error:nil];
NSString *tempDir = [self.notSignedAppPath stringByDeletingLastPathComponent];
[[NSFileManager defaultManager] removeItemAtPath:tempDir error:nil];
}
}
+7 -7
View File
@@ -45,16 +45,16 @@
- (void)startDownloadWithRequest:(NSURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename completion:(void (^)(BOOL success, NSError * _Nullable error))completionBlock
{
dispatch_async(dispatch_get_main_queue(), ^{
// Remove our old caches path so we don't start accumulating files in there
NSString *cachePath = [[self class] sparkleCachePathForBundleIdentifier:bundleIdentifier];
if ([[NSFileManager defaultManager] fileExistsAtPath:cachePath]) {
[[NSFileManager defaultManager] removeItemAtPath:cachePath error:NULL];
}
self.download = [[NSURLDownload alloc] initWithRequest:request delegate:self];
self.desiredFilename = desiredFilename;
self.bundleIdentifier = bundleIdentifier;
self.completionBlock = completionBlock;
// Remove our old caches path so we don't start accumulating files in there
NSString *cachePath = [[self class] sparkleCachePathForBundleIdentifier:self.bundleIdentifier];
if ([[NSFileManager defaultManager] fileExistsAtPath:cachePath]) {
[[NSFileManager defaultManager] removeItemAtPath:cachePath error:NULL];
}
});
}
@@ -80,7 +80,7 @@
NSURL *cacheURL = [[NSFileManager defaultManager] URLForDirectory:NSCachesDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:NULL];
assert(cacheURL != nil);
return [[[cacheURL URLByAppendingPathComponent:bundleIdentifier] URLByAppendingPathComponent:@"Sparkle"] path];
return [[[cacheURL URLByAppendingPathComponent:bundleIdentifier] URLByAppendingPathComponent:@SPARKLE_BUNDLE_IDENTIFIER] path];
}
- (void)download:(NSURLDownload *)__unused d decideDestinationWithSuggestedFilename:(NSString *)name