mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-21 03:09:08 -05:00
fix: name the packs that fail verification
This commit is contained in:
1 parent
9ca1e68007
commit
8e067c1c3a
3 files changed
+19
-2
No files matched your search
@@ -2713,7 +2713,6 @@ def _run_platform_packs(
|
||||
print(f"ERROR: no pack for {', '.join(sorted(set(failed)))}")
|
||||
sys.exit(1)
|
||||
if not all_ok:
|
||||
print("WARNING: some packs have verification errors")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
@@ -4511,6 +4510,7 @@ def verify_and_finalize_packs(
|
||||
if name in expected[pname]:
|
||||
pack_to_platform.setdefault(name, []).append(pname)
|
||||
|
||||
failing: list[str] = []
|
||||
for name in _pack_archives(output_dir):
|
||||
zip_path = os.path.join(output_dir, name)
|
||||
|
||||
@@ -4526,6 +4526,7 @@ def verify_and_finalize_packs(
|
||||
for err in manifest["errors"]:
|
||||
print(f" ERROR: {err}")
|
||||
all_ok = False
|
||||
failing.append(name)
|
||||
inject_manifest(zip_path, manifest)
|
||||
|
||||
# Stage 2: platform conformance (extract + verify)
|
||||
@@ -4569,8 +4570,12 @@ def verify_and_finalize_packs(
|
||||
for err in p_errors:
|
||||
print(f" {err}")
|
||||
all_ok = False
|
||||
failing.append(f"{name} ({pname})")
|
||||
|
||||
generate_sha256sums(output_dir)
|
||||
if failing:
|
||||
# Named at the end, where a 4,000-line log is read, and on stderr.
|
||||
print(f"ERROR: packs failed verification: {', '.join(failing)}", file=sys.stderr)
|
||||
return all_ok
|
||||
|
||||
from packpaths import ( # noqa: E402,F401
|
||||
|
||||
@@ -775,7 +775,8 @@ def _collect_emulator_extras(
|
||||
full_dest = f"{extras_prefix}/{dest}" if extras_prefix else dest
|
||||
if full_dest in seen_dests and full_dest not in taken:
|
||||
continue
|
||||
# Check file exists in repo or data dirs
|
||||
# Only files the database indexes: members of a data
|
||||
# directory are not in it and are not duplicated here.
|
||||
if not (
|
||||
by_name.get(fname)
|
||||
or by_name.get(dest.rsplit("/", 1)[-1])
|
||||
|
||||
@@ -4990,5 +4990,16 @@ class AnAliasNamesItsProfile(unittest.TestCase):
|
||||
self.assertIn(expected, str(caught.exception))
|
||||
|
||||
|
||||
|
||||
class AFailedVerificationIsAnError(unittest.TestCase):
|
||||
"""--all ended on "WARNING: some packs have verification errors" and
|
||||
exit 1: a warning that fails the run, naming no pack."""
|
||||
|
||||
def test_the_last_line_names_the_packs(self):
|
||||
source = (ROOT / "scripts" / "generate_pack.py").read_text()
|
||||
self.assertNotIn("WARNING: some packs have verification errors", source)
|
||||
self.assertIn('print(f"ERROR: packs failed verification: {\', \'.join(failing)}", file=sys.stderr)', source)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user