Commit Graph
17 Commits
Author SHA1 Message Date
Abdessamad Derraz cdf0aa6774 fix: external downloads obey RETROBIOS_OFFLINE 2026-11-21 21:42:19 +01:00
Abdessamad Derraz c07a47362e fix: decide offline once before the release check 2026-11-21 21:42:19 +01:00
Abdessamad Derraz e36516f3b0 refactor: print the hash lookup from packs 2026-11-21 21:42:19 +01:00
Abdessamad Derraz 74fcdd2bc5 refactor: read archive members in one place
core.ziptools.zip_members lists the name, size and crc32 of each member once per archive revision. The site lookup and cards, the gap report, the pack check, the romset importer, the recipe identification and build, provenance, derivations and the atom pool read it instead of opening each archive again.

Each reader also tested a .zip suffix and skipped the .variants/ copies (x.zip.1a2b3c4d): the site lookup listed no member of a copy, the gap report's member index never saw one, the pack check never compared a copy's members, and the pack builders copied a copy without its CRC test. They now use is_archive_path. The inner ROM index of the resolver reads copies too, and a copy answers only for a member no primary holds.
2026-11-21 10:30:40 +01:00
Abdessamad Derraz 8a8fa71fbc refactor: route network access through upstream
Branch heads (scrapers, FBNeo import, data directories) resolve through
core.upstream.resolve_head, with cache_dir=None to keep nothing under
.cache/upstream. Streaming downloads (large files, external pack files,
data directory archives, scraper downloads, standalone probe) go through
one core.upstream.download: scratch then rename, size cap, retries of a
cut stream, a 5xx or a rate limit. The shared rate limit wait reads
GoatCounter's X-Rate-Limit-Reset, so site insights, download.py,
indexnow and the contributor list use the same retrying client.

list_gitlinks raises TruncatedListingError on a partial tree, read
from one tree walk shared with list_tree (Forgejo paging included).
The Recalbox configs/ listing is paged with the shared page cap.
2026-11-21 10:30:13 +01:00
Abdessamad Derraz 526d7f09c7 fix: accept each listed hash of a download
download_external compared the digest with the field as a string, so a list or a comma-joined field never matched. It reads the strongest declared field with declared_hash_lists and accepts any of its values. The release asset lookup reads the same helper instead of its own copy.
2026-11-21 10:29:37 +01:00
Abdessamad Derraz e636614ae3 refactor: read pipeline output with shared walkers
The four generate_pack parsers walk the lines under a full pack's header
through one generator, and the two verify parsers the lines under a
summary through another. The three offline comparisons hold the policy
through resolve.packfiles.offline() and read their inputs from one
setup function; platformpack is imported once.
2026-11-21 06:04:31 +01:00
Abdessamad Derraz 23e3cc06b3 fix: find held records by the resolver hash rule 2026-11-21 06:01:53 +01:00
Abdessamad Derraz 2308039452 fix: read a database record by its path field 2026-11-21 06:01:46 +01:00
Abdessamad Derraz e462b03848 fix: compare declared hashes in one place 2026-11-21 06:01:30 +01:00
Abdessamad Derraz 8bc1fcb5db refactor: index the database by path once
model.database.record_at and sha1_at read one cached path index with
normpath keys. They replace records_by_path of resolve.packfiles, the
manifest's own sha1 index, the per-call indexes of regionaudit,
emulatorcheck and hidden_extras, and the linear scan of held_record.
resolve_sha1 drops its by_path argument. A path spelled with ./ or a
doubled slash now finds its record everywhere; the database writes none,
so the output is the same.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz cc85999e22 refactor: read zip member crcs in one place
core.ziptools.readable_zip_member_crcs answers None for a file that is
no readable archive, and zip_member_crcs reads it as empty. The covering
archive choice of resolve.packfiles uses it in place of its own reader,
so it still gives up on an unreadable candidate and now shares the cache.
No behavior change.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 348d5b51c3 refactor: read hashes and the registry one way
Hash fields go through core.hashing.parse_hash_list, which also splits comma-joined list items: the truth model compared a comma-joined sha256 list as one value. _registry.yml goes through load_platform_registry (required= where an absent file must stop the run), database.json through load_database, file and member digests through file_digest and stream_hashes. download.py and check_release read SHA256SUMS.txt with one parser: a sha256sum -b line matched nothing in download.py and the pack went unchecked.
2026-11-20 18:28:40 +01:00
Abdessamad Derraz a9c0dcac3c fix: ship the archive covering a twin md5 pin
RetroDECK pins bios/cdibios.zip and bios/stvbios.zip twice, the older
MAME set for its mame component and the full set for the RetroArch
core. The first pin in system order shipped the smaller set, which
current MAME rejects (cdi.cpp:922 needs the slave MCU ROM). The archive
whose members cover the other now ships: it serves both readers.
2026-11-19 06:33:17 +01:00
Abdessamad Derraz 3853ca2f1c refactor: public names for cross-module reads 2026-11-18 22:59:51 +01:00
Abdessamad Derraz 825c527d11 refactor: one reader of a declared destination 2026-11-18 13:47:56 +01:00
Abdessamad Derraz 0b532366d0 refactor: move pack library code into packs/ 2026-11-18 13:47:31 +01:00