Commit Graph
36 Commits
Author SHA1 Message Date
Abdessamad Derraz 8bc497cf15 fix: check zip member paths with core.ziptools
The data directory refresh dropped any name containing .. in silence,
wrote a backslash as a filename character and let a drive letter or a
backslash traversal through. The pack integrity check flagged Read..me
as a traversal. Both now use safe_member_parts, and an unsafe member
fails the refresh of its key instead of thinning the tree.
2026-11-21 06:00:53 +01:00
Abdessamad Derraz 6138d43dfb fix: resolve data dir revisions with core.upstream
get_remote_sha parsed a GitLab subgroup as its first two segments, asked
the branches endpoint, which resolves no tag, sent the token to any URL
containing github and skipped the refresh on one 502. resolve_head reads
subgroups, encodes the ref, scopes the token and retries.
2026-11-21 06:00:44 +01:00
Abdessamad Derraz 95ed63a3f3 refactor: one etag probe for buildbot and refresh
The buildbot check now waits 30 s like the refresh, not 15.
2026-11-21 06:00:31 +01:00
Abdessamad Derraz 75b5fb987e fix: check zipped pack members like the builder 2026-11-21 06:00:14 +01:00
Abdessamad Derraz 434d660647 refactor: route atomic writes through one helper 2026-11-21 06:00:14 +01:00
Abdessamad Derraz b5cfa9179f refactor: drop the unused deterministic zip writer 2026-11-21 05:59:58 +01:00
Abdessamad Derraz 8fdc00e07f refactor: look up a path's sha1 with sha1_at 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 82d3f595de refactor: read data/.versions.json in one place 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 67cb99606d refactor: read data dirs and inherits in one place 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 7be8a7cd7b fix: stop on one line when pyyaml is missing 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 35f335d001 refactor: read target overrides through one reader 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 812f2609db fix: read every source yaml as utf-8 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 1dc99849bc refactor: read pack part names from packs.parts
download.py kept its own copy of the part-name pattern. packs.parts.part_of gives the pack, part number and count, and is_part is built on it.
2026-11-20 20:05:46 +01:00
Abdessamad Derraz 48eb208786 refactor: one list of the names a core goes by
model.profiles.profile_names(key, profile) gives a profile's key then
the names its cores: lists, and core_key moves there from contentlayout
with core_key_index, upstream_profile_index keyed by it. The inline
{key, *cores} sets and scans in resolve and packs read profile_names;
the two roms folder matchers read core_key_index. The parameter of
select_emulator_profiles is renamed requested.

Matching stays exact everywhere it was exact. Folding case and -/_
everywhere would merge distinct profiles: dosbox_pure (Batocera,
AmberELEC, EmuELEC) would also name dosbox-pure-unleashed, and
pcsx_rearmed would also name pcsx_rearmed_standalone (RetroPie's
pcsx-rearmed). Only roms folder rows (retrobat BSNES, Snes9x, mGBA,
emudeck vice-x64sc...) depend on the fold, and those already fold.
The alias lookup of select_emulator_profiles now compares string core
names, as every other reader does. No output change.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 0095b23512 refactor: read a declaration's slot one way
model.declarations.declared_slot(entry, prefix) is the declared
destination less the platform's BIOS root, empty when the entry names no
path. platform_declarations, platform_declared_contents,
declared_destinations, system_core_reach, find_collisions and
platform_claims read it in place of destination-or-name. The core extras
of the builder and the manifest read declared_destination, and the
builder's case twin list asks Placed.block.

Behavior: the 134 EmuDeck system:md5 entries (destination: '') claim no
slot. They were filed under their name, sony-playstation:<md5>, a path
nothing else names: slots and collisions drop those claims, and
case_folded_slots skips an empty slot. Their names and contents still
count as declared, in the root folder as before.
2026-11-20 20:03:26 +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 1c978f3083 refactor: fold destinations with one rule
comparable_destination moves to core.paths. Placed, placement_block,
the shared group merge of model.platforms and LauncherPlace.fold read it
in place of their own lower(). It also trims surrounding blanks and
slashes and folds with casefold: no destination, collection path or
launcher name differs under those rules today, so the output is the
same.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz ca3ff1d4c5 refactor: place every file through Placed
data_directory_members, pack_data_tree and manifest_core_entries take
the Placed record instead of three loose sets and a fold flag, and verify's
replay of the builder (_builder_placement), hidden_extras and the
emulator pack check keep a Placed of their own. hidden_extras records the
sha1 at each taken path through the new Placed content option, which keeps
its same-content case twin rule. No behavior change.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 899f591575 refactor: name the profile kinds in model.profiles
lists_files(profile) answers whether a profile declares files, false
for a launcher or an alias, and is_emulator(profile) whether it counts as
an emulator, false for an alias or a test core. Eighteen inline checks in
model, resolve and packs read them; each keeps the set it tested.
model.systems keeps its own check: it sits below model.profiles. No
behavior change.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz b679edb133 refactor: one rule for system and maker names
packs.naming.system_display_name names a system in a pack file name,
read by system_tag in place of its copy of the loop. names_manufacturer
spells a maker through model.collection.manufacturer_slug, and
resolve.identity reads the maker folder with ownership.maker_of_relative,
the rule maker_folder applies. No behavior change.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 6b3a588231 refactor: walk the collection's zips once
build_supplemental_index and _supplemental_locations each opened every
ZIP under bios/. Both read _zip_members, cached per root, so an
unreadable archive is reported once instead of twice. No other change.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 8f153e2b89 refactor: read a platform's check mode one way
nativemode.platform_mode(config) replaces the inline
config.get("verification_mode", "existence") of the builder, the
manifest, slots, integrity, extras, gaps, coverage and review. A value
outside the schema enum now falls back to the default everywhere, as
coverage already did. Every platform declares a valid mode.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz cf03dcb2ef refactor: share CLI options and default paths
core.paths holds the default database, platforms, emulators and bios paths, core.cli declares the options built on them (add_repo_inputs) and the --emulator/--system modes verify and generate_pack share. model.targets.target_scope answers --target for a command line, model.profiles.no_profile_for_systems the system with no emulator. tests/sources.declared_options reads the options a script declares through either form.
2026-11-20 18:28:46 +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 56290f3bb7 fix: name an unanswered directory by its path 2026-11-19 20:23:54 +01:00
Abdessamad Derraz 022591a67e fix: settle three validation checks
The retrodeck games fallback is computed from the manifests and went
stale with the data tree manifest change. Two docstrings carried clause
semicolons. The install run test read bytes_done as the sum of finished
files, but it counts every byte arrived, a file still in transfer
included, as progress does; the test now checks that bound and the doc
says it.
2026-11-19 16:11:49 +01:00
Abdessamad Derraz ff69210b18 feat: pin forge data trees, follow nightly ones
A data tree whose source names a revision is fetched at the commit its
branch points to and listed at that commit, whose bytes never change.
A source with no revision (the buildbot's nightly assets) is marked
rolling: the installer writes each listed file as the source serves it,
checked against its ZIP CRC-32, as RetroArch's own downloader does, and
the install record keeps it in place on the next run. The PPSSPP list
refused 49 of 169 files after each buildbot rebuild.
2026-11-19 08:59:42 +01:00
Abdessamad Derraz 3853ca2f1c refactor: public names for cross-module reads 2026-11-18 22:59:51 +01:00
Abdessamad Derraz 238f70c7a7 refactor: one copy of each duplicated helper 2026-11-18 22:16:55 +01:00
Abdessamad Derraz 2c8a9cfad8 refactor: one digest loop for files and streams 2026-11-18 21:42:28 +01:00
Abdessamad Derraz 29f5c48a2c refactor: system names and guides below packs 2026-11-18 19:31:27 +01:00
Abdessamad Derraz 825c527d11 refactor: one reader of a declared destination 2026-11-18 13:47:56 +01:00
Abdessamad Derraz b4573d310b refactor: one keyword-option guard in core 2026-11-18 13:47:56 +01:00
Abdessamad Derraz 27330be60a refactor: leave the commands their own code 2026-11-18 13:47:56 +01:00
Abdessamad Derraz f48b66b540 refactor: keep split packs beside platformpack 2026-11-18 13:47:31 +01:00
Abdessamad Derraz 0b532366d0 refactor: move pack library code into packs/ 2026-11-18 13:47:31 +01:00