mirror of
https://github.com/zeldaret/tp
synced 2026-06-29 11:40:55 -04:00
Merge with upstream
This commit is contained in:
+23
-1
@@ -583,5 +583,27 @@ def load_elfs(str_paths):
|
||||
return static, plfs
|
||||
|
||||
|
||||
def convert_arg_line_to_args(arg_line: str):
|
||||
return arg_line.split(' ')
|
||||
|
||||
|
||||
def _read_args_from_files(args: List[str]):
|
||||
new_args: List[str] = []
|
||||
for arg in args:
|
||||
if not arg or arg[0] != '@':
|
||||
new_args.append(arg)
|
||||
else:
|
||||
with open(arg[1:], 'r') as file:
|
||||
file_args: List[str] = []
|
||||
for line in file:
|
||||
for file_arg in convert_arg_line_to_args(line.strip()):
|
||||
file_args.append(file_arg)
|
||||
file_args = _read_args_from_files(file_args)
|
||||
new_args.extend(file_args)
|
||||
|
||||
return new_args
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
makerel()
|
||||
args = _read_args_from_files(sys.argv[1:])
|
||||
makerel(args)
|
||||
|
||||
+2
-2
@@ -247,7 +247,7 @@ def setup(debug: bool, game_path: Path, tools_path: Path):
|
||||
|
||||
c27_mwcceppc_old = c27.joinpath("mwcceppc.old.exe")
|
||||
c27_mwcceppc_orignal = c27.joinpath("mwcceppc.exe")
|
||||
c27_mwcceppc_patched = c27.joinpath("mwcceppc_patched.exe")
|
||||
c27_mwcceppc_patched = c27.joinpath("mwcceppc_modded.exe")
|
||||
|
||||
def patch_compiler(src: Path, dst: Path, apply: bool):
|
||||
with src.open("rb") as src_file:
|
||||
@@ -803,7 +803,7 @@ def remove_unused_asm(check: bool):
|
||||
@click.option("--debug/--no-debug")
|
||||
@click.option(
|
||||
"--rels",
|
||||
default=False,
|
||||
default=True,
|
||||
is_flag=True,
|
||||
help="RELs will also be build and checked",
|
||||
)
|
||||
|
||||
+12
-3
@@ -9,7 +9,9 @@ if os.name != 'nt':
|
||||
winedevices = os.path.join(wineprefix, 'dosdevices')
|
||||
|
||||
def in_wsl() -> bool:
|
||||
return 'microsoft-standard' in uname().release
|
||||
# wsl1 has Microsoft, wsl2 has microsoft-standard
|
||||
release = uname().release
|
||||
return 'microsoft-standard' in release or 'Microsoft' in release
|
||||
|
||||
def import_d_file(in_file) -> str:
|
||||
out_lines = []
|
||||
@@ -36,8 +38,15 @@ def import_d_file(in_file) -> str:
|
||||
# shortcut for z:
|
||||
path = path[2:].replace('\\', '/')
|
||||
elif in_wsl():
|
||||
path = path[0:1] + path[2:]
|
||||
path = os.path.join('/mnt', path.replace('\\', '/'))
|
||||
if path.startswith(r'\\wsl'):
|
||||
# first part could be wsl$ or wsl.localhost
|
||||
pos = path.find('\\', 2)
|
||||
pos = path.find('\\', pos + 1)
|
||||
path = path[pos:]
|
||||
path = path.replace('\\', '/')
|
||||
else:
|
||||
path = path[0:1] + path[2:]
|
||||
path = os.path.join('/mnt', path.replace('\\', '/'))
|
||||
else:
|
||||
# use $WINEPREFIX/dosdevices to resolve path
|
||||
path = os.path.realpath(os.path.join(winedevices, path.replace('\\', '/')))
|
||||
|
||||
Reference in New Issue
Block a user