mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-21 03:09:08 -05:00
feat: publish the corrected platform files
export_native now writes into exports/ by default, and beside each platform's corrected file a report naming every change, where the run printed five per kind. A new site page lists each platform with its original file, a download of the corrected one and every corrected, filled or withheld value. Each platform page links to its row.
This commit is contained in:
1 parent
71b59eb2a3
commit
ca13e6036d
8 files changed
+317
-7
No files matched your search
@@ -8,7 +8,7 @@ formats that carry code are patched rather than regenerated, so the checker
|
||||
a platform ships keeps working.
|
||||
|
||||
Usage:
|
||||
python scripts/export_native.py --all --fetch
|
||||
python scripts/export_native.py --all --fetch # into exports/
|
||||
python scripts/export_native.py --platform recalbox --upstream-dir up/
|
||||
python scripts/export_native.py --platform retrobat --refresh-cache
|
||||
"""
|
||||
@@ -28,7 +28,7 @@ from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
|
||||
from artifacts import file_lock, write_bytes_atomic, write_text_atomic
|
||||
from artifacts import file_lock, write_bytes_atomic, write_if_changed, write_text_atomic
|
||||
import yaml
|
||||
|
||||
from common import (
|
||||
@@ -562,9 +562,32 @@ def export_platform(
|
||||
if len(issues) > 10:
|
||||
messages.append(f"and {len(issues) - 10} more validation failures")
|
||||
|
||||
write_report(output_dir / f"{platform}.json", {
|
||||
"platform": platform,
|
||||
"originals": wanted_sources(exporter, systems, scraped),
|
||||
"files": sorted(produced),
|
||||
"summary": summary,
|
||||
"hashes_corrected": applied,
|
||||
"hashes_filled": filled,
|
||||
"sizes_corrected": resized,
|
||||
"sizes_removed": unsized,
|
||||
"hashes_cleared": cleared,
|
||||
"requirements_corrected": requirements,
|
||||
"withheld": list(withheld),
|
||||
"invalid": issues,
|
||||
})
|
||||
return not issues, messages
|
||||
|
||||
|
||||
def write_report(path: Path, report: dict) -> None:
|
||||
"""What one platform's export changed, for the page that publishes it.
|
||||
|
||||
The run prints five examples per kind of change. The page lists them
|
||||
all, so the maintainer reading it finds each line of the diff named.
|
||||
"""
|
||||
write_if_changed(str(path), json.dumps(report, indent=2) + "\n")
|
||||
|
||||
|
||||
def run(
|
||||
platforms: list[str],
|
||||
truth_dir: str,
|
||||
@@ -626,7 +649,7 @@ def main() -> None:
|
||||
group.add_argument("--all", action="store_true", help="every platform")
|
||||
group.add_argument("--platform", type=platform_arg, help="a single platform")
|
||||
parser.add_argument(
|
||||
"--output-dir", default="dist/upstream",
|
||||
"--output-dir", default="exports",
|
||||
help="directory the corrected platform files go to (default: %(default)s)",
|
||||
)
|
||||
parser.add_argument(
|
||||
|
||||
Reference in new issue
Block a user