From 4ca3f6a1b3c03200dd8409fb9d1c0624ecc4b286 Mon Sep 17 00:00:00 2001 From: gasinvein Date: Tue, 25 Jan 2022 15:32:13 +0400 Subject: [PATCH] Ensure appdata releases tag is replaced rather than added --- Telegram/build/changelog2appdata.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/build/changelog2appdata.py b/Telegram/build/changelog2appdata.py index 37beb5aee5..a3d0388940 100755 --- a/Telegram/build/changelog2appdata.py +++ b/Telegram/build/changelog2appdata.py @@ -54,7 +54,11 @@ def get_changelog_xml(changelog, max_items=None): def update_appdata(appdata_path, changelog, max_items=None): appdata = ET.parse(appdata_path) - appdata.getroot().append( + root = appdata.getroot() + releases = root.find("releases") + if releases is not None: + root.remove(releases) + root.append( get_changelog_xml(changelog, max_items) ) appdata.write(appdata_path, encoding="utf-8", xml_declaration=True)