mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-05-07 16:33:03 +00:00
dist/macos: remove any existing matching builds in appcast
This commit is contained in:
parent
382c942790
commit
080bd530f4
12
dist/macos/update_appcast_tip.py
vendored
12
dist/macos/update_appcast_tip.py
vendored
@ -36,13 +36,23 @@ with open("sign_update.txt", "r") as f:
|
|||||||
attrs[key] = value
|
attrs[key] = value
|
||||||
|
|
||||||
# We need to register our namespaces before reading or writing any files.
|
# We need to register our namespaces before reading or writing any files.
|
||||||
ET.register_namespace("sparkle", "http://www.andymatuschak.org/xml-namespaces/sparkle")
|
namespaces = { "sparkle": "http://www.andymatuschak.org/xml-namespaces/sparkle" }
|
||||||
|
for prefix, uri in namespaces.items():
|
||||||
|
ET.register_namespace(prefix, uri)
|
||||||
|
|
||||||
# Open our existing appcast and find the channel element. This is where
|
# Open our existing appcast and find the channel element. This is where
|
||||||
# we'll add our new item.
|
# we'll add our new item.
|
||||||
et = ET.parse('appcast.xml')
|
et = ET.parse('appcast.xml')
|
||||||
channel = et.find("channel")
|
channel = et.find("channel")
|
||||||
|
|
||||||
|
# Remove any items with the same version. If we have multiple items with
|
||||||
|
# the same version, Sparkle will report invalid signatures if it picks
|
||||||
|
# the wrong one when updating.
|
||||||
|
for item in channel.findall("item"):
|
||||||
|
version = item.find("sparkle:version", namespaces)
|
||||||
|
if version is not None and version.text == build:
|
||||||
|
channel.remove(item)
|
||||||
|
|
||||||
# Create the item using some absoultely terrible XML manipulation.
|
# Create the item using some absoultely terrible XML manipulation.
|
||||||
item = ET.SubElement(channel, "item")
|
item = ET.SubElement(channel, "item")
|
||||||
elem = ET.SubElement(item, "title")
|
elem = ET.SubElement(item, "title")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user