From 9b2c72fe4fc7ccdc0d17fb0fa26caf5de2c2948b Mon Sep 17 00:00:00 2001 From: oliver Date: Wed, 14 Oct 2026 10:39:34 +0800 Subject: [PATCH] Linux updater: take the package name from the release asset, not the download URL. Forgejo can hand out /attachments/ links; the release API's own names stay authoritative. (The v0.4.19 updater already works against releases/latest, which returns named download URLs.) Co-Authored-By: Claude Opus 5.5 --- packaging/linux/netx_admin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/linux/netx_admin.py b/packaging/linux/netx_admin.py index 885a38d..5379b5f 100644 --- a/packaging/linux/netx_admin.py +++ b/packaging/linux/netx_admin.py @@ -318,6 +318,8 @@ def _release_to_candidate(rel: dict, source: str, arch: str, api_url: str = "") return { "source": source, "latest": tag.lstrip("vV"), + # Forgejo serves /attachments/: the URL does not carry the file name. + "name": str(pkg["name"]), "url": url_of(pkg), "sha256_url": url_of(sha) if sha else "", "sha256": "", @@ -581,7 +583,7 @@ def cmd_fetch_update(a: argparse.Namespace) -> None: if work.exists(): shutil.rmtree(work) work.mkdir(parents=True) - name = Path(urllib.parse.urlparse(info["url"]).path).name or "netx-update.tar.gz" + name = str(info.get("name") or "") or Path(urllib.parse.urlparse(info["url"]).path).name if not asset_name_re(a.arch).match(name): die("unexpected_asset_name", name) pkg = work / name