From 20fe96061cacbbb2a93fe6c8a0a1b65ecfb3bed2 Mon Sep 17 00:00:00 2001 From: K900 Date: Wed, 19 Feb 2025 12:58:07 +0300 Subject: [PATCH] maintainers/scripts/kde: handle duplicate tarballs properly --- maintainers/scripts/kde/generate-sources.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/maintainers/scripts/kde/generate-sources.py b/maintainers/scripts/kde/generate-sources.py index b03ef3cc5f6b..e4241cced120 100755 --- a/maintainers/scripts/kde/generate-sources.py +++ b/maintainers/scripts/kde/generate-sources.py @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -i python3 -p "python3.withPackages(ps: [ ps.beautifulsoup4 ps.click ps.httpx ps.jinja2 ps.pyyaml ])" +#!nix-shell -i python3 -p "python3.withPackages(ps: [ ps.beautifulsoup4 ps.click ps.httpx ps.jinja2 ps.packaging ps.pyyaml ])" import base64 import binascii import json @@ -11,6 +11,7 @@ import bs4 import click import httpx import jinja2 +import packaging.version as v import utils @@ -104,6 +105,12 @@ def main(set: str, version: str, nixpkgs: pathlib.Path, sources_url: Optional[st hash = client.get(url + ".sha256").text.split(" ", maxsplit=1)[0] assert hash + if existing := results.get(project_name): + old_version = existing["version"] + if v.parse(old_version) > v.parse(version): + print(f"{project_name} {old_version} is newer than {version}, skipping...") + continue + results[project_name] = { "version": version, "url": "mirror://kde" + urlparse(url).path,