[vlc-devel] [PATCH] macosx/sparkle: set feed URL based on architecture and add debug

Felix Paul Kühne fkuehne at videolan.org
Sun Dec 6 18:29:27 CET 2020


From: Felix Paul Kühne <felix at feepk.net>

---
 modules/gui/macosx/VLCMain.m | 25 +++++++++++++++++++++++++
 share/Info.plist.in          |  2 --
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
index 3e08c48da9..f0b1d6d4a9 100644
--- a/modules/gui/macosx/VLCMain.m
+++ b/modules/gui/macosx/VLCMain.m
@@ -385,6 +385,31 @@ - (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle
 
     return YES;
 }
+
+/* use the correct feed depending on the hardware architecture */
+- (nullable NSString *)feedURLStringForUpdater:(SUUpdater *)updater
+{
+#ifdef __x86_64__
+    return @"https://update.videolan.org/vlc/sparkle/vlc-intel64.xml";
+#else
+    return @"https://update.videolan.org/vlc/sparkle/vlc-arm64.xml";
+#endif
+}
+
+- (void)updaterDidNotFindUpdate:(SUUpdater *)updater
+{
+    msg_Dbg(p_intf, "No update found");
+}
+
+- (void)updater:(SUUpdater *)updater failedToDownloadUpdate:(SUAppcastItem *)item error:(NSError *)error
+{
+    msg_Warn(p_intf, "Failed to download update with error %li", error.code);
+}
+
+- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error
+{
+    msg_Err(p_intf, "Updater aborted with error %li", error.code);
+}
 #endif
 
 #pragma mark -
diff --git a/share/Info.plist.in b/share/Info.plist.in
index 0fe1a4682d..711721fdee 100644
--- a/share/Info.plist.in
+++ b/share/Info.plist.in
@@ -1520,8 +1520,6 @@
 	<string>VLCApplication</string>
 	<key>NSSupportsAutomaticGraphicsSwitching</key>
 	<true/>
-	<key>SUFeedURL</key>
-	<string>https://update.videolan.org/vlc/sparkle/vlc-intel64.xml</string>
 	<key>SUPublicDSAKeyFile</key>
 	<string>dsa_pub.pem</string>
 	<key>UTExportedTypeDeclarations</key>
-- 
2.24.3 (Apple Git-128)



More information about the vlc-devel mailing list