fix(update): on Linux "Skip this version" is kept, and no longer costs the game its saves #2283
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2283
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/linux-update-skip-saves"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On Linux, choosing "Skip this version" in the game's own update question at two starts leaves the game showing no saves: it runs on an empty
user/folder beside the game from then on, while the real saves sit in~/.local/share/hookshot.This is the question
bin/hookshotasks when the player starts it themselves (a terminal, a Steam or Lutris shortcut to it), withcurlandzenityinstalled. The folder's launcher and the builder ask in their own windows and are not affected.What happens
hos_update_checkwriteshookshot_update_skip.txttouser/beside the game, as on Windows. Linux keeps its saves in$XDG_DATA_HOME/hookshotsince7eeb91a, and right after the question the same start moves auser/folder beside the game there, as saves from an earlier build (saves_dir):saves-moved.txtis written though no save moved, and the next start asks again, because the check reads the file beside the game.hos_user_dirbecomes theuser/beside the game, which holds only the skip file. No saves are shown, and new ones are written there.The change
--user's folder.mainasks about the update once that place is known (the call moves below the lines that set it; the Windows order of effects is the same, its check does not use the saves' place).A skip that an earlier start already moved to the data folder is read again. One in a
user/folder from an earlier build moves with the saves and is read too.A player already in the second state keeps running beside the game after this change, since both places then hold a
savefolder and the move rightly does not pick one. Their earlier saves are in~/.local/share/hookshot/save; removing theuserfolder beside the game (if nothing was saved since) brings them back.Tested
tests/test_linux_update_skip.py(new) builds the game's start ashos_main.chas it (the part ofmainthat finds the folder, asks about an update and picks the saves' place, withsaves_dir), withhos_update.candhost/posix/win32_posix.c, puts it in a game folder of its own asbin/hookshot, and starts it with acurlthat names a release and azenitythat answers "Skip this version":user/orsaves-moved.txtappears beside the game, a newer release is asked about again; auser/from an earlier build with saves and a skip moves once and is not asked.main: fails at the second start, "the game uses …/Games/Hookshot/user for its saves".python -I -B tests/run_all.py: nothing new fails.Not tested in a built game or with the real
zenityand GitHub: the functions are the source's own, the two tools are stand-ins.Looks good. The diagnosis is clear and the fix is small.
Checked:
hos_update_checknow runs afterhos_user_diris set (--user, orsaves_dir(beside_user)), so the skip file is read and written in the saves' place.hos_user_diris never NULL at that call, so the newsnprintf/mkdirare safe. The old-user/case still works: the move runs first, then the skip is read from the new place.hos_update_checkthere is the separate#ifdef _WIN32implementation, which doesn't usehos_user_dir, and theexternand the new path sit in the Linux section. Only the call moves, afterimage/hos_romfs_dir/hos_user_dirare set, so nothing changes for it. The non-Linux stub is untouched.run_all.pydiscovery, skips cleanly on Windows/macOS, and needs no game.Nits, none blocking:
mkdir(hos_user_dir)isn't recursive, so with a nested--userpath that doesn't exist yet the skip just isn't saved (the question is asked again, no harm). Also the extramkdircreates the data folder beforesaves_direver sees a later start, which is fine since it only runs aftersaves_dir.CI: all green except
appimage, which fails the same way on main's latest Linux AppImage run, so it isn't from this PR.github-sync referenced this pull request2026-11-12 06:22:54 +00:00