From 0ba917b0d69d59547aa58ff034282db142644412 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 24 Jul 2023 21:09:13 +0200 Subject: [PATCH] autoupdate_app_sources: don't push an upgrade if newest version is actually older than current version --- autoupdate_app_sources/autoupdate_app_sources.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/autoupdate_app_sources/autoupdate_app_sources.py b/autoupdate_app_sources/autoupdate_app_sources.py index 5d2080c..3e4b4d7 100644 --- a/autoupdate_app_sources/autoupdate_app_sources.py +++ b/autoupdate_app_sources/autoupdate_app_sources.py @@ -175,6 +175,18 @@ class AppAutoUpdater: print(f"Current version in manifest: {self.current_version}") print(f"Newest version on upstream: {new_version}") + # Maybe new version is older than current version + # Which can happen for example if we manually release a RC, + # which is ignored by this script + # Though we wrap this in a try/except pass, because don't want to miserably crash + # if the tag can't properly be converted to int tuple ... + try: + if tag_to_int_tuple(self.current_version) > tag_to_int_tuple(new_version): + print("Up to date (current version appears more recent than newest version found)") + continue + except: + pass + if self.current_version == new_version: print("Up to date") continue