Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_report_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

# Tools that use report_paths and must not define their own copy again.
SHARED = ("anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml", "gen_d3d12_stubs",
"glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "world_index",
"world_lights_paths", "world_names")
"glb_inspect", "meshlet_page", "navmesh_index", "restofworld_model_join", "rpf_probe", "tile_probe",
"world_index", "world_lights_paths", "world_names")
# The one tool that still carries its own copy (an open pull request edits its call site). Do not add to this list:
# import report_paths instead.
LEGACY_COPIES = {"navmesh_decode"}
Expand Down
16 changes: 7 additions & 9 deletions tools/restofworld_model_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
import time
import zlib

ROOT = os.path.dirname(os.path.abspath(__file__))
if ROOT not in sys.path:
sys.path.insert(0, ROOT)
from report_paths import same_report_path # noqa: E402

ZHDR = re.compile(rb"\x78[\x01\x5e\x9c\xda]|KB2[a-z]")
SYS_BASE = 0x50000000
GFX_BASE = 0x60000000
Expand Down Expand Up @@ -1263,21 +1268,14 @@ def byte_count_arg(text):


def _aliases_input(out_path, source_path):
if os.path.normcase(os.path.realpath(out_path)) == os.path.normcase(os.path.realpath(source_path)):
if same_report_path(out_path, source_path):
return True
try:
if os.path.samefile(out_path, source_path):
return True
except OSError:
pass
if os.path.isdir(source_path):
index_path = os.path.join(source_path, "index.json")
if os.path.normcase(os.path.realpath(out_path)) == os.path.normcase(os.path.realpath(index_path)):
if same_report_path(out_path, index_path):
return True
if not os.path.isfile(out_path):
return False
if os.path.isfile(index_path) and os.path.samefile(out_path, index_path):
return True
src_root = os.path.normcase(os.path.abspath(source_path))
target = os.path.normcase(os.path.abspath(out_path))
if os.path.dirname(target) == src_root and target.endswith((".bin", ".bk2")):
Expand Down