Move decompression logic to configure.py

This commit is contained in:
Cuyler36
2024-07-04 15:26:35 -04:00
parent c59604011b
commit 8da2e86ff6
2 changed files with 6 additions and 5 deletions
-5
View File
@@ -93,11 +93,6 @@ if __name__ == "__main__":
else:
print(f"No changes in {target[0]}, skipping build.")
try:
# Check if foresta.rel.szs exists but not foresta.rel, and if so, decompress
if not os.path.exists(c.REL) and os.path.exists(c.REL_SZS):
print("Decompressing foresta.rel.szs to foresta.rel")
subprocess.call([f'./{c.ORTHRUS}', 'ncompress', 'yaz0', '-d', c.REL_SZS, c.REL])
if args.v:
subprocess.run(['ninja', '-v'], check=True)
else:
+6
View File
@@ -9,6 +9,7 @@ import json
import os
import pickle
import re
import subprocess
from io import StringIO
from sys import executable as PYTHON, platform
@@ -30,6 +31,11 @@ assert os.path.exists("tools/1.3.2/mwcceppc.exe") and \
os.path.exists("tools/1.2.5n/mwcceppc.exe"), \
"Error: Codewarrior not found!"
# Check if foresta.rel.szs exists but not foresta.rel, and if so, decompress
if not os.path.exists(c.REL) and os.path.exists(c.REL_SZS):
print("Decompressing foresta.rel.szs to foresta.rel")
subprocess.call([f'./{c.ORTHRUS}', 'ncompress', 'yaz0', '-d', c.REL_SZS, c.REL])
# Check binaries were added
assert os.path.exists(c.DOL) and os.path.exists(c.REL), \
"Error: Base binaries not found!"