Add an option to try downloading but use the cached file if that fails #2288
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.
By default, Winetricks fails when the cached version of a file is old and the newer file can't be downloaded. The user can get around that with the --force option, which uses whatever is in the cache whether or not its checksum is correct, but that requires the user to run
winetricks
a second time with --force and it also disables the check for whether the winetrick is already installed. The --cached-acceptable option provides a middle ground: If the checksum of the cached file does not match, it tries to download the correct file (like the default behavior), but if the download fails, it falls back to using the cached file (like --force but without the other effects). That behavior is ideal for when websites might be down but the user already has in their cache sufficiently recent versions of the files they need.--cached-acceptable may be used with or without --force: When combined with --force it leaves --force's other effects in place and affects only the download process.