-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add download functionality to ulwgl_run #30
Merged
GloriousEggroll
merged 36 commits into
Open-Wine-Components:main
from
R1kaB3rN:download
Feb 18, 2024
Merged
Add download functionality to ulwgl_run #30
GloriousEggroll
merged 36 commits into
Open-Wine-Components:main
from
R1kaB3rN:download
Feb 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- When the user does not specify the PROTONPATH, attempt to download the latest Proton if Proton cannot be found in either the Steam compat tools or local cache. Otherwise, prioritize referring to existing ones -- $HOME/.local/share/Steam/compatibilitytools.d and $HOME/.cache/ULWGL. - Effectively, new installations will always download the latest Proton, while existing ones will simply be warned of a later version. Downloading is avoided if the latest version already exists in the cache, and the cache will be used as a last resort to set the variable. When we're unable to find an existing Proton or download one, we raise an error.
- Add missing return statement - Delete property access of name
- When we're downloading the latest Proton, it's possible the user can interrupt download or extraction process which can lead to corrupted or incomplete files. As a result, in the next run of the launcher, a FileNotFoundError can be falsely raised for the $PROTONPATH/proton file. In the case of an interrupt, be sure to remove the relevant files before we exit.
- When extracting from the cache to the compatibilitytools.d directory, be sure to remove the leftover data after the interrupt to avoid future errors.
- Code block in which the digest mismatched, user interrupt or failure to download/no internet.
- Update the check_env tests for new usage when PROTONPATH is not set by mocking the callout.
- Referencing the tuple element within the array for the tarball name then parsing it was becoming highly error prone/unreadable.
- Prefer a shorter message when download fails or Proton cannot be found, and reference ULWGL-Proton Github repository instead of GE-Proton
- Arguably the most important test of this test suite as we do **not** want to remove files that isn't ours. We test both the positive and negative case. In the latter, the state of the cache or Steam compat should be left the same state as it was before executing the function when passed files that do not exist.
- Creates more test files within the compat/cache directories to verify that there wasn't any side effects after executing _cleanup
- Fixes a logic error by terminating prematurely when referencing an old Proton version that has been saved in the cache
- Removes assertions that check for state of variables when an error is raised and updates comments
- In the case the cache is empty ' found in: None' can be printed.
LGTM! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #29 and #16
With the current rewrite, when the user does not specify the
$PROTONPATH,
no download of the latest Proton is made on their behalf and this PR aims add that same functionality.When no Proton is specified, we only attempt to download the latest Proton if a Proton cannot be found in the Steam compat tools directory. Otherwise, referring to
$HOME/.cache/ULWGL
if something wrong happens when downloading or if the user is offline.Concretely the order is:
Effectively, new installations will always download the latest Proton, while existing ones will simply be warned to the console of a later version. Downloading is avoided if the latest version already exists in the cache, and the cache will be used as a last resort (e.g. download fails, digest mismatch, etc.) to set the variable. When we're unable to find an existing Proton or download one, we simply terminate the script as we there's no point using it without specifying Proton.
TODO: