mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 18:59:07 -05:00
feat: packs leave out what the emulator installs
A file or tree installed with the emulator is already on the user's machine, so packs, install manifests and verify's pack count leave it out. bundled is scoped by mode like any entry: Dolphin's Sys and PPSSPP's assets ship with the standalone releases, not with the libretro cores, so they now follow the libretro build only and still reach RetroArch packs. PrimeHack, standalone only, ships its own Sys.
This commit is contained in:
1 parent
c589ed49b8
commit
ddc7432825
10 files changed
+69
-6
No files matched your search
@@ -91,6 +91,7 @@ from validation import (
|
||||
validated_choice,
|
||||
agnostic_substitute,
|
||||
_build_validation_index,
|
||||
deliverable,
|
||||
filter_files_by_mode,
|
||||
)
|
||||
|
||||
@@ -1449,7 +1450,7 @@ def generate_emulator_pack(
|
||||
pack_structure = profile.get("pack_structure")
|
||||
files = expand_agnostic_entries(
|
||||
expand_directory_entries(
|
||||
filter_files_by_mode(profile.get("files", []), standalone),
|
||||
deliverable(profile.get("files", []), standalone),
|
||||
db,
|
||||
standalone,
|
||||
),
|
||||
@@ -1675,7 +1676,7 @@ def generate_emulator_pack(
|
||||
# profile declares wins over the copy a tree bundles at the same
|
||||
# path (Dolphin's real dsp_rom.bin over Sys/GC's free one).
|
||||
# A tree only one build reads follows that build, like a file.
|
||||
for dd in filter_files_by_mode(
|
||||
for dd in deliverable(
|
||||
profile.get("data_directories", []), standalone
|
||||
):
|
||||
ref_key = dd.get("ref", "")
|
||||
|
||||
@@ -875,6 +875,11 @@ def _collect_emulator_extras(
|
||||
for destination in seen:
|
||||
taken[destination] = baseline_claims.setdefault(destination, {})
|
||||
for u in undeclared:
|
||||
if u.get("bundled"):
|
||||
# Installed with the emulator for this build: already on the
|
||||
# user's machine. The mode a file is bundled for was settled
|
||||
# upstream, an entry scoped to another build never gets here.
|
||||
continue
|
||||
if not u["in_repo"] and absent is None:
|
||||
continue
|
||||
# For archive entries, use the archive name for resolution
|
||||
|
||||
@@ -525,6 +525,17 @@ def filter_files_by_mode(files: list[dict], standalone: bool) -> list[dict]:
|
||||
return result
|
||||
|
||||
|
||||
def deliverable(entries: list[dict], standalone: bool) -> list[dict]:
|
||||
"""The entries of one build a pack has to bring.
|
||||
|
||||
A file or tree installed with the emulator is already on the user's
|
||||
machine: shipping it again only weighs the pack. `bundled` is scoped by
|
||||
`mode` like any entry, so PPSSPP's assets, shipped by the standalone
|
||||
release and not by the libretro core, still reach a RetroArch pack.
|
||||
"""
|
||||
return [e for e in filter_files_by_mode(entries, standalone) if not e.get("bundled")]
|
||||
|
||||
|
||||
def find_validated_variant(
|
||||
file_entry: dict,
|
||||
db: dict,
|
||||
|
||||
+10
-3
@@ -94,6 +94,7 @@ from validation import (
|
||||
_parse_validation,
|
||||
build_ground_truth,
|
||||
check_file_validation,
|
||||
deliverable,
|
||||
filter_files_by_mode,
|
||||
outside_gap_scope,
|
||||
)
|
||||
@@ -774,6 +775,12 @@ def _mark_unplaced(config: dict, undeclared: list[dict], profiles: dict) -> None
|
||||
|
||||
unplaced = unplaceable_extras(config, undeclared, profiles)
|
||||
for u in undeclared:
|
||||
if u.get("bundled"):
|
||||
# Installed with the emulator, so already on the user's machine:
|
||||
# the pack leaves it out, held or not.
|
||||
u["in_pack"] = False
|
||||
u["omitted"] = "installed with its emulator"
|
||||
continue
|
||||
reason = unplaced.get(
|
||||
(u.get("emulator", ""), u.get("name", ""), u.get("path") or "")
|
||||
)
|
||||
@@ -1713,7 +1720,7 @@ def verify_emulator(
|
||||
for emu_name, profile in sorted(selected):
|
||||
files = expand_agnostic_entries(
|
||||
expand_directory_entries(
|
||||
filter_files_by_mode(profile.get("files", []), standalone),
|
||||
deliverable(profile.get("files", []), standalone),
|
||||
db,
|
||||
standalone,
|
||||
),
|
||||
@@ -1733,7 +1740,7 @@ def verify_emulator(
|
||||
]
|
||||
|
||||
# Check data directories (only notice if not cached)
|
||||
for dd in filter_files_by_mode(
|
||||
for dd in deliverable(
|
||||
profile.get("data_directories", []), standalone
|
||||
):
|
||||
ref = dd.get("ref", "")
|
||||
@@ -2010,7 +2017,7 @@ def verify_emulator(
|
||||
file_severity[dest] = sev
|
||||
|
||||
# The profile's data trees follow its files in the pack.
|
||||
for dd in filter_files_by_mode(profile.get("data_directories", []), standalone):
|
||||
for dd in deliverable(profile.get("data_directories", []), standalone):
|
||||
cache = (data_registry or {}).get(dd.get("ref", ""), {}).get("local_cache", "")
|
||||
if not cache or not os.path.isdir(cache):
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user