1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

Merge pull request #2032 from Salamandar/fix_autoupdater

autoupdate.version_regex: allow multiple capture groups, splitted by '.'
This commit is contained in:
Alexandre Aubin 2024-02-17 16:04:07 +01:00 committed by GitHub
commit 0b3f41b916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"]