mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-23 18:17:53 -06:00
refactor: build platform packs without printing
build_platform_pack and build_split_packs return what the build came to and print nothing. print_platform_pack holds the report lines, and generate_pack and generate_split_packs compose the two. The variant choice, the plan and the data directory pass return their notices instead of printing them. The callers that silenced stdout to get a record now call the builder.
This commit is contained in:
1 parent
977d3f6874
commit
d8570c6480
15 files changed
+295
-205
No files matched your search
@@ -117,9 +117,8 @@ def check_narrowed_packs(
|
||||
load_target_config(platform, target, platforms_dir) if target else None
|
||||
)
|
||||
record = archive.PackRecord()
|
||||
with contextlib.redirect_stdout(io.StringIO()), \
|
||||
contextlib.redirect_stderr(io.StringIO()):
|
||||
built = platformpack.generate_pack(
|
||||
with contextlib.redirect_stderr(io.StringIO()):
|
||||
built = platformpack.build_platform_pack(
|
||||
platform, platforms_dir, db, "bios", "",
|
||||
emulators_dir=emulators_dir, zip_contents=zip_contents,
|
||||
data_registry=registry, emu_profiles=profiles,
|
||||
@@ -131,7 +130,7 @@ def check_narrowed_packs(
|
||||
emulators_dir, profiles, target_cores=target_cores,
|
||||
data_dir_registry=registry,
|
||||
**{k: v for k, v in narrowing.items() if k != "target_name"},
|
||||
) if built else None
|
||||
) if built.zip_path else None
|
||||
compared += 1
|
||||
name = f"{platform} {label}"
|
||||
if report is None:
|
||||
|
||||
@@ -68,12 +68,11 @@ def check_split_packs(
|
||||
)
|
||||
full = archive.PackRecord()
|
||||
parts: dict[str, archive.PackRecord] = {}
|
||||
with contextlib.redirect_stdout(io.StringIO()), \
|
||||
contextlib.redirect_stderr(io.StringIO()):
|
||||
platformpack.generate_pack(
|
||||
with contextlib.redirect_stderr(io.StringIO()):
|
||||
platformpack.build_platform_pack(
|
||||
platform, platforms_dir, db, "bios", "", record=full, **args,
|
||||
)
|
||||
platformpack.generate_split_packs(
|
||||
platformpack.build_split_packs(
|
||||
platform, platforms_dir, db, "bios", "", records=parts, **args,
|
||||
)
|
||||
lines = split_differences(full, parts, archive.same_bytes)
|
||||
|
||||
Reference in new issue
Block a user