From 6c7a63162534eba1c85fc2eab86ead53a67f1299 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 5 Mar 2024 22:25:57 +0100 Subject: [PATCH 1/2] use lstrip and rstrip instead of strip to fix some edge case --- tools/autoupdate_app_sources/autoupdate_app_sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/autoupdate_app_sources/autoupdate_app_sources.py b/tools/autoupdate_app_sources/autoupdate_app_sources.py index f9297c5..513ddf9 100755 --- a/tools/autoupdate_app_sources/autoupdate_app_sources.py +++ b/tools/autoupdate_app_sources/autoupdate_app_sources.py @@ -300,7 +300,7 @@ class AppAutoUpdater: @staticmethod def tag_to_int_tuple(tag: str) -> tuple[int, ...]: - tag = tag.strip("v").replace("-", ".").strip(".") + tag = tag.lstrip("v").replace("-", ".").rstrip(".") int_tuple = tag.split(".") assert all(i.isdigit() for i in int_tuple), f"Cant convert {tag} to int tuple :/" return tuple(int(i) for i in int_tuple) From c6e2059a911db3ec1f0f39d2e3011fa088cee213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 6 Mar 2024 18:47:56 +0100 Subject: [PATCH 2/2] Better handling of version format in relevant_versions() --- tools/autoupdate_app_sources/autoupdate_app_sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/autoupdate_app_sources/autoupdate_app_sources.py b/tools/autoupdate_app_sources/autoupdate_app_sources.py index 513ddf9..9f6fe70 100755 --- a/tools/autoupdate_app_sources/autoupdate_app_sources.py +++ b/tools/autoupdate_app_sources/autoupdate_app_sources.py @@ -274,7 +274,7 @@ class AppAutoUpdater: elif tag.startswith("release-"): t_to_check = tag.split("-", 1)[-1].replace("-", ".") - if re.match(r"^v?[\d\.]*\-?\d$", t_to_check): + if re.match(r"^v?\d+(\.\d+)*(\-\d+)?$", t_to_check): return AppAutoUpdater.tag_to_int_tuple(t_to_check) print(f"Ignoring tag {t_to_check}, doesn't look like a version number") return None