Skip to content

Never take a Mac's ._ metadata files for programs - #589

Open
thehobbit85 wants to merge 1 commit into
elripalda:mainfrom
thehobbit85:claude/fix-mac-metadata-never-a-program
Open

thehobbit85 wants to merge 1 commit into
elripalda:mainfrom
thehobbit85:claude/fix-mac-metadata-never-a-program

Conversation

@thehobbit85

Copy link
Copy Markdown
Contributor

What this changes

Follow-up to #401, for the rest of #390.

A Mac writes a ._ metadata file beside each file it puts on a drive formatted for Windows (exFAT, FAT32), and bsdtar adds them to archives packed on a Mac. #401 kept them out of the native build check only. Elsewhere, the launcher still took them by name:

  • Setup: find_setup sorts names, so ._Game-setup.exe came before Game-setup.exe and was picked as the game's setup.
  • Programs: is_program accepts a .exe on Windows, and a .AppImage or .x86_64 on Linux, by name alone, so a ._ file counted as a program.
  • AppImages: installed_image gives up when it sees two AppImages, so a ._Game.AppImage beside Game.AppImage stopped the launcher reading the game's built-in manifest.

A file whose name starts with ._ is now never a program, a setup or an installed AppImage.

Limits: the ._ files are still unpacked from archives as before; they're only never picked. The Linux install failure when unpacking a ._Game.AppImage is left to #409, which keeps a file that isn't a real AppImage as a plain file.

How you tested it

Run on macOS against eaf7ca2, with synthetic ._ files (the AppleDouble header and a few bytes).

  • Four new tests, each failing on main before the change: the setup beside a ._ copy is the real one; a ._game.x86_64 isn't a Linux program; a ._Game.exe isn't a Windows program; a ._Game.AppImage beside the real one doesn't hide it.

  • Rust: 1,219 passed, 1 ignored. UI: 1,019 passed, 11 skipped. git diff --check clean.

  • npm test passes

  • node --test tests/*.test.cjs passes

  • Tried it in the launcher (npm run dev)

Checklist

  • One change per pull request
  • No version bump or patch notes (those are done at release time)
  • Does not change what developers can write in recomplauncher.json

A Mac writes a ._ file beside each file on a drive formatted for Windows, and into archives it packs. elripalda#401 kept them out of the native build check only. They could still be picked as the game's setup, listed as programs by name, or make an installed AppImage look like one of two. They're now never a program, a setup or an AppImage.
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.

1 participant