Check game version compatibility when installing specific version #2228
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.
Problem
ckan install identifier=version
currently bypasses game version compatibility checks. This means that an incompatible module that you normally couldn't install at all, can be installed just by specifying any version:This makes the
identifier=version
format unsafe by default, since compatibility checking is just turned off; this could be a problem if I intend to install an older compatible version but make a typo in the version number.It also isn't documented anywhere that it works this way, so a user might not even realize that he's installing incompatible versions once he discovers this argument format.
Changes
This pull request checks that the version the user specified is compatible with the game version. It also adds the module version to the error message:
To avoid losing the ability to install incompatible mods if the user so chooses, a new explicit Cmdline option
--allow-incompatible
is added:This works for both the
identifier=version
format and the simpleridentifier
format, so you now don't have to know the version number to install the latest incompatible version of a mod: