Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: Remove VERSION.txt and other text files from compatibility tool folder #1151

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Aug 20, 2024

Overview

This PR updates the logic when running steamtinkerlaunch compat del to also remove files ending with .txt when removing all files in the compatibility tool folder. This fixes the compat del command failing to remove the SteamTinkerLaunch folder in the SROOT/compatibilitytools.d/SteamTinkerLaunch because it does not account for removing the VERSION.txt file that may be generated by ProtonUp-Qt.

There are also a couple of style changes to remove some indentation.

Background

When installing SteamTinkerLaunch with ProtonUp-Qt, ProtonUp-Qt will create a VERSION.txt file. It does this for various compatibility tools so that it can display the version on its UI (i.e. for SteamTinkerLaunch it might display v14.0.20240728-1, but Luxtorpeda it might display v70). ProtonUp-Qt creates this file in the directory of the compatibility tool, e.g. ~/.local/share/Steam/compatibilitytools.d/SteamTinkerLaunch. The logic to add the VERSION.txt was added by me in DavidoTek/ProtonUp-Qt#174.

However this logic presents a problem. If a user installs SteamTinkerLaunch with ProtonUp-Qt, but then tries to remove the compatibility tool symlink themselves with steamtinkerlaunch compat del, this will fail because SteamTinkerLaunch is very careful about what files it removes, limiting only to the script file itself and files ending with .vdf (such as compatibiltiytool.vdf manifest file created for and required by the Steam Client for all compatibility tools). Once it removes these files it then tries to remove its compatibility tool install folder, but it cannot do this if there are files still in the folder, which would be the case as SteamTinkerLaunch does not remove the VERSION.txt file created by ProtonUp-Qt.

Solution

To fix this, we now remove the VERSION.txt file created by ProtonUp-Qt by adding an additional check to remove files ending with .txt to the find command. Alternatively we could have used something like rm -rf but the existing check is careful, and I wanted to preserve this (and it makes sense to be careful inside of the Steam folder).

@sonic2kk
Copy link
Owner Author

Seems to work in testing, can probably be merged soon, but will also check if there is anything we can/should do on the ProtonUp-Qt side. Not sure if we use steamtinkerlaunch compat del but we might want to remove VERSION.txt on the ProtonUp-Qt side anyway.

@sonic2kk
Copy link
Owner Author

There should be no work remaining on the ProtonUp-Qt side. This can be rebased and merged, as it works fine in testing.

@sonic2kk sonic2kk force-pushed the remove-protonupqt-version-file branch from 57cc30c to dc4e8c3 Compare August 28, 2024 22:59
@sonic2kk sonic2kk merged commit 83fa7bf into master Aug 28, 2024
2 checks passed
@sonic2kk sonic2kk deleted the remove-protonupqt-version-file branch August 28, 2024 23:01
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