mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Make phased rollout interval an app cast element not an enclosure one
Previous behavior doesn't work properly with delta update items. They should not be treated separately.
This commit is contained in:
1 parent
f9d421f851
commit
60fcc89b7e
4 files changed
+11
-10
No files matched your search
Vendored
+7
-7
@@ -84,7 +84,7 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
_versionString = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemVersionStringKey] copy];
|
||||
_osString = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastAttributeOsType] copy];
|
||||
_propertiesDictionary = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class], [NSDate class], [NSArray class]]] forKey:SUAppcastItemPropertiesKey];
|
||||
_phasedRolloutInterval = [decoder decodeObjectOfClass:[NSNumber class] forKey:SUAppcastAttributePhasedRolloutInterval];
|
||||
_phasedRolloutInterval = [decoder decodeObjectOfClass:[NSNumber class] forKey:SUAppcastElementPhasedRolloutInterval];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -155,7 +155,7 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
}
|
||||
|
||||
if (self.phasedRolloutInterval != nil) {
|
||||
[encoder encodeObject:self.phasedRolloutInterval forKey:SUAppcastAttributePhasedRolloutInterval];
|
||||
[encoder encodeObject:self.phasedRolloutInterval forKey:SUAppcastElementPhasedRolloutInterval];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,6 +294,11 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
_minimumSystemVersion = [(NSString *)[dict objectForKey:SUAppcastElementMinimumSystemVersion] copy];
|
||||
_maximumSystemVersion = [(NSString *)[dict objectForKey:SUAppcastElementMaximumSystemVersion] copy];
|
||||
_minimumAutoupdateVersion = [(NSString *)[dict objectForKey:SUAppcastElementMinimumAutoupdateVersion] copy];
|
||||
|
||||
NSString* rolloutIntervalString = [(NSString *)[dict objectForKey:SUAppcastElementPhasedRolloutInterval] copy];
|
||||
if (rolloutIntervalString != nil) {
|
||||
_phasedRolloutInterval = @(rolloutIntervalString.integerValue);
|
||||
}
|
||||
|
||||
NSString *shortVersionString = [enclosure objectForKey:SUAppcastAttributeShortVersionString];
|
||||
if (nil == shortVersionString) {
|
||||
@@ -317,11 +322,6 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
} else if ([_installationType isEqualToString:SPUInstallationTypeInteractivePackage]) {
|
||||
SULog(SULogLevelDefault, @"warning: '%@' for %@ is deprecated. Use '%@' instead.", SPUInstallationTypeInteractivePackage, SUAppcastAttributeInstallationType, SPUInstallationTypeGuidedPackage);
|
||||
}
|
||||
|
||||
NSString* enclosureRolloutIntervalString = [enclosure objectForKey:SUAppcastAttributePhasedRolloutInterval];
|
||||
if (enclosureRolloutIntervalString != nil) {
|
||||
_phasedRolloutInterval = @(enclosureRolloutIntervalString.integerValue);
|
||||
}
|
||||
|
||||
// Find the appropriate release notes URL.
|
||||
NSString *releaseNotesString = [dict objectForKey:SUAppcastElementReleaseNotesLink];
|
||||
|
||||
Vendored
+1
-1
@@ -82,7 +82,7 @@ extern NSString *const SUAppcastElementMinimumSystemVersion;
|
||||
extern NSString *const SUAppcastElementMaximumSystemVersion;
|
||||
extern NSString *const SUAppcastElementReleaseNotesLink;
|
||||
extern NSString *const SUAppcastElementTags;
|
||||
extern NSString *const SUAppcastAttributePhasedRolloutInterval;
|
||||
extern NSString *const SUAppcastElementPhasedRolloutInterval;
|
||||
|
||||
extern NSString *const SURSSAttributeURL;
|
||||
extern NSString *const SURSSAttributeLength;
|
||||
|
||||
Vendored
+1
-1
@@ -75,7 +75,7 @@ NSString *const SUAppcastElementMinimumSystemVersion = @"sparkle:minimumSystemVe
|
||||
NSString *const SUAppcastElementMaximumSystemVersion = @"sparkle:maximumSystemVersion";
|
||||
NSString *const SUAppcastElementReleaseNotesLink = @"sparkle:releaseNotesLink";
|
||||
NSString *const SUAppcastElementTags = @"sparkle:tags";
|
||||
NSString *const SUAppcastAttributePhasedRolloutInterval = @"sparkle:phasedRolloutInterval";
|
||||
NSString *const SUAppcastElementPhasedRolloutInterval = @"sparkle:phasedRolloutInterval";
|
||||
|
||||
NSString *const SURSSAttributeURL = @"url";
|
||||
NSString *const SURSSAttributeLength = @"length";
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
<!-- The best chosen release -->
|
||||
<item>
|
||||
<title>Version 3.0</title>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" sparkle:version="3.0" length="1346234" sparkle:phasedRolloutInterval="86400" />
|
||||
<sparkle:phasedRolloutInterval>86400</sparkle:phasedRolloutInterval>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" sparkle:version="3.0" length="1346234" />
|
||||
<sparkle:deltas>
|
||||
<enclosure url="http://localhost:1337/3.0_from_2.0.patch"
|
||||
sparkle:version="3.0"
|
||||
|
||||
Reference in new issue
Block a user