From eefb56c2c040b0792d90d3942e085752e886e61a Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 4 Dec 2022 14:30:37 +0000 Subject: [PATCH] update.py: Check appcast version is correct platform --- update.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/update.py b/update.py index 5d9c9b42..8b24ed08 100644 --- a/update.py +++ b/update.py @@ -178,8 +178,22 @@ class Updater(object): return None + if sys.platform == 'darwin': + sparkle_platform = 'macos' + + else: + # For *these* purposes anything else is the same as 'windows', as + # non-win32 would be running from source. + sparkle_platform = 'windows' + for item in feed.findall('channel/item'): ver = item.find('enclosure').attrib.get('{http://www.andymatuschak.org/xml-namespaces/sparkle}version') + ver_platform = item.find('enclosure').attrib.get( + '{http://www.andymatuschak.org/xml-namespaces/sparkle}os' + ) + if ver_platform != sparkle_platform: + continue + # This will change A.B.C.D to A.B.C+D sv = semantic_version.Version.coerce(ver)