Skip to content

manifest: exclude a manifest spelled with another case (MANIFEST-WALK-CASE-EXCLUDE) - #1441

Open
Dashhhhhhhh wants to merge 1 commit into
ProjectLeonida:mainfrom
Dashhhhhhhh:fix/manifest-walk-case-exclude
Open

Dashhhhhhhh wants to merge 1 commit into
ProjectLeonida:mainfrom
Dashhhhhhhh:fix/manifest-walk-case-exclude

Conversation

@Dashhhhhhhh

Copy link
Copy Markdown

Claimed in the coordination issue as: MANIFEST-WALK-CASE-EXCLUDE

What and why

tools/manifest.py walk() decided the manifest was outside the game folder by comparing os.path.normcase(os.path.realpath()). That keeps the case you typed on macOS. A folder created as Game and --out game/MANIFEST.json are one file on APFS, so the next create treated the manifest as an input and refused to replace it, and verify listed it as NEW and then printed OK.

The scan now compares report_paths.path_key, which folds case on a volume that ignores it. Recreating a real manifest under the other spelling works. A hashed file under the other spelling is still refused, and a hard link to a hashed file is still refused. manifest_verifier.py has the same exclude key; pull requests #344 and #899 already edit that file, so this change leaves it alone.

Tested

python -I tests/test_manifest.py (42 tests) and python -I tests/test_report_paths.py (22 tests), on macOS APFS. The new tests exclude PKG/Manifest.json from a folder created as pkg, recreate that manifest, and refuse PKG/ROOT.DAT. No game files.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md (not a translator change).

Made with Cursor

normcase(realpath()) kept Game and game apart on macOS, so the next create treated the manifest as an input and verify listed it as new. The scan now uses the shared path key, which folds that case, and a hashed file under the other spelling is still refused.

Co-authored-by: Cursor <cursoragent@cursor.com>

@tiguan26 tiguan26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Comparing through path_key folds case on a case-insensitive volume, where normcase(realpath()) keeps the typed case on macOS, so Game/manifest.json and game/manifest.json are now the same file for --exclude and for the output-inside-game-folder check.

AI-assisted (Claude).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants