refactor: split core.upstream by subject

HTTP to the forges moves to core.forgehttp, comparisons, trees and
clone history to core.upstreamtree. core.upstream keeps repositories,
the cache and revisions.
This commit is contained in:
Abdessamad Derraz committed 2026-11-24 06:20:52 +01:00
1 parent ce92eff0aa
commit 263a64c0e0
65 files changed
+1417 -1337

No files matched your search

+3 -3
View File
@@ -10,7 +10,7 @@ from collections.abc import Sequence
from pathlib import Path
import core_probe as cp
from core import upstream
from core import forgehttp
from core.statefile import now_iso
from probes.host import main_cache
from probes.standaloneemulators import Emulator
@@ -62,8 +62,8 @@ def fetch(emu: Emulator, cache: Path | None = None) -> dict:
folder = (cache or cache_root()) / emu.name
folder.mkdir(parents=True, exist_ok=True)
partial = folder / f"{asset['name']}.part"
# Whole or absent, retried on a cut stream (core.upstream.download).
upstream.download(asset["url"], partial, timeout=600)
# Whole or absent, retried on a cut stream (core.forgehttp.download).
forgehttp.download(asset["url"], partial, timeout=600)
sha256 = cp.file_digest(partial, "sha256")
target = folder / sha256 / asset["name"]
target.parent.mkdir(parents=True, exist_ok=True)
+2 -2
View File
@@ -10,7 +10,7 @@ import sys
from pathlib import Path
import core_probe as cp
from core import upstream
from core import forgehttp
from probes.appimage import fetch, github_releases, select_asset
from probes.standaloneemulators import EMULATORS, Emulator
from probes.standalonerecord import Busy, RunFailed, measure, validate
@@ -31,7 +31,7 @@ def run_mode(args: argparse.Namespace) -> int:
if args.mode == "fetch":
try:
print(json.dumps(fetch(emu), indent=2))
except (cp.ProbeError, upstream.UpstreamError, OSError, http.client.HTTPException,
except (cp.ProbeError, forgehttp.UpstreamError, OSError, http.client.HTTPException,
subprocess.CalledProcessError) as exc:
print(f"ERROR: {exc}", file=sys.stderr)
return 1