From 5812a1e204cc6765cad8c6c4a481e8f271621601 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 28 Jul 2024 16:57:56 +0900 Subject: [PATCH] Stop creating empty asm dirs (#387) * Stop creating empty asm dirs * try to fix test --- CHANGELOG.md | 3 +++ README.md | 2 +- pyproject.toml | 2 +- src/splat/__init__.py | 2 +- src/splat/segtypes/common/c.py | 6 ++++-- test/basic_app/expected/asm/matchings/.gitkeep | 0 6 files changed, 10 insertions(+), 5 deletions(-) delete mode 100644 test/basic_app/expected/asm/matchings/.gitkeep diff --git a/CHANGELOG.md b/CHANGELOG.md index 283d160e..52131abd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # splat Release Notes +### 0.24.7 +* splat no longer creates unnecessary directories for asm + ### 0.24.6 * Handle PS-X EXE header that includes .text/.data vram address diff --git a/README.md b/README.md index 76fb8075..3e1e1827 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The brackets corresponds to the optional dependencies to install while installin If you use a `requirements.txt` file in your repository, then you can add this library with the following line: ```txt -splat64[mips]>=0.24.6,<1.0.0 +splat64[mips]>=0.24.7,<1.0.0 ``` ### Optional dependencies diff --git a/pyproject.toml b/pyproject.toml index 036359a7..8eb06d48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "splat64" # Should be synced with src/splat/__init__.py -version = "0.24.6" +version = "0.24.7" description = "A binary splitting tool to assist with decompilation and modding projects" readme = "README.md" license = {file = "LICENSE"} diff --git a/src/splat/__init__.py b/src/splat/__init__.py index d37fd3eb..c673c4bc 100644 --- a/src/splat/__init__.py +++ b/src/splat/__init__.py @@ -3,7 +3,7 @@ __package_name__ = __name__ # Should be synced with pyproject.toml -__version__ = "0.24.6" +__version__ = "0.24.7" __author__ = "ethteck" from . import util as util diff --git a/src/splat/segtypes/common/c.py b/src/splat/segtypes/common/c.py index 3eaabdae..c0f4721b 100644 --- a/src/splat/segtypes/common/c.py +++ b/src/splat/segtypes/common/c.py @@ -152,8 +152,6 @@ def split(self, rom_bytes: bytes): if self.rom_start != self.rom_end: asm_out_dir = options.opts.nonmatchings_path / self.dir matching_asm_out_dir = options.opts.matchings_path / self.dir - asm_out_dir.mkdir(parents=True, exist_ok=True) - matching_asm_out_dir.mkdir(parents=True, exist_ok=True) self.print_file_boundaries() @@ -466,6 +464,8 @@ def create_asm_dependencies_file( if func_name in self.global_asm_funcs or is_new_c_file: outpath = asm_out_dir / self.name / (func_name + ".s") + outpath.parent.mkdir(parents=True, exist_ok=True) + depend_list.append(outpath) f.write(f" \\\n {outpath}") else: @@ -474,6 +474,8 @@ def create_asm_dependencies_file( if rodata_name in self.global_asm_rodata_syms or is_new_c_file: outpath = asm_out_dir / self.name / (rodata_name + ".s") + outpath.parent.mkdir(parents=True, exist_ok=True) + depend_list.append(outpath) f.write(f" \\\n {outpath}") diff --git a/test/basic_app/expected/asm/matchings/.gitkeep b/test/basic_app/expected/asm/matchings/.gitkeep deleted file mode 100644 index e69de29b..00000000