From d507a2567135f0ccd50f9585f3728588849165a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sat, 17 Feb 2024 15:41:57 +0100 Subject: [PATCH] autoupdate.version_regex: allow multiple capture groups, splitted by '.' --- autoupdate_app_sources/autoupdate_app_sources.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoupdate_app_sources/autoupdate_app_sources.py b/autoupdate_app_sources/autoupdate_app_sources.py index 3b7fbf8..fdfd74a 100755 --- a/autoupdate_app_sources/autoupdate_app_sources.py +++ b/autoupdate_app_sources/autoupdate_app_sources.py @@ -255,7 +255,8 @@ class AppAutoUpdater: match = re.match(version_regex, tag) if match is None: return None - return match.group(1) + # Basically: either groupdict if named capture gorups, sorted by names, or groups() + return ".".join(dict(sorted(match.groupdict().items())).values() or match.groups()) def version_numbers(tag: str) -> Optional[tuple[int, ...]]: filter_keywords = ["start", "rc", "beta", "alpha"]