mirror of
https://github.com/hansjone/netx.git
synced 2026-10-15 12:13:21 +08:00
Linux updater: take the package name from the release asset, not the download URL.
Forgejo can hand out /attachments/<uuid> 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 <noreply@anthropic.com>
This commit is contained in:
parent
4508d5e9d2
commit
9b2c72fe4f
1 changed files with 3 additions and 1 deletions
|
|
@ -318,6 +318,8 @@ def _release_to_candidate(rel: dict, source: str, arch: str, api_url: str = "")
|
||||||
return {
|
return {
|
||||||
"source": source,
|
"source": source,
|
||||||
"latest": tag.lstrip("vV"),
|
"latest": tag.lstrip("vV"),
|
||||||
|
# Forgejo serves /attachments/<uuid>: the URL does not carry the file name.
|
||||||
|
"name": str(pkg["name"]),
|
||||||
"url": url_of(pkg),
|
"url": url_of(pkg),
|
||||||
"sha256_url": url_of(sha) if sha else "",
|
"sha256_url": url_of(sha) if sha else "",
|
||||||
"sha256": "",
|
"sha256": "",
|
||||||
|
|
@ -581,7 +583,7 @@ def cmd_fetch_update(a: argparse.Namespace) -> None:
|
||||||
if work.exists():
|
if work.exists():
|
||||||
shutil.rmtree(work)
|
shutil.rmtree(work)
|
||||||
work.mkdir(parents=True)
|
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):
|
if not asset_name_re(a.arch).match(name):
|
||||||
die("unexpected_asset_name", name)
|
die("unexpected_asset_name", name)
|
||||||
pkg = work / name
|
pkg = work / name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue