Repository navigation
bink_index: use tools/report_paths.same_report_path for the --out guards (EGEN-BINK-SHARED-PATH, DeepSeek2) - #6209
evilclanker9000 wants to merge 3 commits into
Conversation
The private copy compared normcase(realpath()) and samefile(), so an --out that differs from a scanned report only by case passed on a case-folding volume (vfat, exFAT, CIFS) and on macOS's default APFS, where the shared helper asks the volume itself. The three guards in main() and the directory-scan skip now call the shared helper.
The list assertion fails on the tool before the switch (no 'from report_paths import same_report_path') and passes after it, and it keeps a private copy from coming back.
On upstream/main tools/bink_index.py has no same_report_path at all, so this identity check fails there and passes with the switch.
|
Merging this alone breaks the caller of the helper you delete: ools/bink_names.py:372, 379, 386 still call �ink_index.same_output_path(...) through the module. Measured with this branch's ools/bink_index.py over main's tests (no game files, everything hand-built): python -I tests/test_bink_names.py -> Ran 33 tests ... FAILED (errors=36), first traceback AttributeError: module 'bink_index' has no attribute 'same_output_path'. Did you mean: 'same_report_path'? (same suite on main: OK). Either move those three call sites to |
|
Our #6069 does the same bink_index -> report_paths move and keeps |
|
Superseded by #5635 (deepseek/5-bink-same-out), opened earlier and covering the same |
tools/bink_index.pycarried its ownsame_output_pathfor the--outguards(
tools/bink_index.py:308-315onmain). It comparednormcase(realpath())and triedsamefile, so on a volumethat folds case without
normcasenoticing — a vfat/exFAT/CIFS mount on Linux, or macOS's default APFS — an--outthat differs from a scanned report or from the carve manifest only by case passed the guards and the secondwrite truncated the first. Every other switched tool already uses the shared helper, which asks the volume itself
(
same_name_on_folding_volume) and folds composed/decomposed accents on macOS.What changed
tools/bink_index.py: the privatesame_output_pathis gone; the module importssame_report_pathfromtools/report_paths.pythe wayworld_names.pyand the other tools do (script directoryadded to
sys.pathbecause-Ikeeps it off), and the four call sites use it.tests/test_report_paths.py:bink_indexjoinsSHARED, so the tool must import the helper and may not define acopy again.
tests/test_bink_index.py: a test assertsbink_index.same_report_path is report_paths.same_report_path.No behaviour change on Windows (there
normcasealready lowercased, and the helper starts with the same two rules).Test
Before the source change (test edits only, as pushed in the last two commits):
After the change:
No GPU needed, no game files.
Notes
bink_index.pybecause it is the only stdlib tool left with a private copy that thetest_no_new_copies_of_same_report_pathcheck does not catch (it only looks for functions namedsame_report_path);navmesh_decodeis the documented exception.same_output_path = same_report_pathalias, so the tool matches theother switched tools and the identity test above is meaningful.
normcasefolds there anyway); the sharedhelper's own tests cover it with mocked volumes.
AI-assisted.