Don't defer some of sparkle-cli delegate callbacks

This commit is contained in:
Zorg committed 2021-03-28 16:35:21 -07:00
1 parent 5ae944778a
commit 2614af86ff
1 file changed
+20 -31
+20 -31
View File
@@ -57,27 +57,20 @@
return self;
}
// Because the user driver dispatches to the main queue asynchronously, we should do so here too
// to preserve the order of handled events
- (void)updater:(SPUUpdater *)__unused updater willScheduleUpdateCheckAfterDelay:(NSTimeInterval)delay
- (void)updater:(SPUUpdater *)__unused updater willScheduleUpdateCheckAfterDelay:(NSTimeInterval)delay __attribute__((noreturn))
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.verbose) {
fprintf(stderr, "Last update check occurred too soon. Try again after %0.0f second(s).", delay);
}
exit(EXIT_SUCCESS);
});
if (self.verbose) {
fprintf(stderr, "Last update check occurred too soon. Try again after %0.0f second(s).", delay);
}
exit(EXIT_SUCCESS);
}
- (void)updaterWillIdleSchedulingUpdates:(SPUUpdater *)__unused updater
- (void)updaterWillIdleSchedulingUpdates:(SPUUpdater *)__unused updater __attribute__((noreturn))
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.verbose) {
fprintf(stderr, "Automatic update checks are disabled. Exiting.\n");
}
exit(EXIT_SUCCESS);
});
if (self.verbose) {
fprintf(stderr, "Automatic update checks are disabled. Exiting.\n");
}
exit(EXIT_SUCCESS);
}
// If the installation is interactive, we can show an authorization prompt for requesting additional privileges,
@@ -99,24 +92,20 @@
// In case we find an update during probing, otherwise we leave this to the user driver
- (void)updater:(SPUUpdater *)__unused updater didFindValidUpdate:(SUAppcastItem *)__unused item
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.probingForUpdates) {
if (self.verbose) {
fprintf(stderr, "Update available!\n");
}
exit(EXIT_SUCCESS);
if (self.probingForUpdates) {
if (self.verbose) {
fprintf(stderr, "Update available!\n");
}
});
exit(EXIT_SUCCESS);
}
}
- (void)updaterDidNotFindUpdate:(SPUUpdater *)__unused updater
- (void)updaterDidNotFindUpdate:(SPUUpdater *)__unused updater __attribute__((noreturn))
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.verbose) {
fprintf(stderr, "No update available!\n");
}
exit(EXIT_FAILURE);
});
if (self.verbose) {
fprintf(stderr, "No update available!\n");
}
exit(EXIT_FAILURE);
}
- (void)updater:(SPUUpdater *)__unused updater didAbortWithError:(NSError *)error