Fixes for installing .ckan files and DarkKAN mods #4006
Merged
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.
Problems
@JonnyOThan has been working with .ckan files for mods that aren't indexed yet and finding lots of bugs:
ckan install -c
currently doesn't work. If you use it with a module that's in one of your metadata repos, it'll try to install the version from the repo, and for mods that aren't there, it reports that it can't find the mod even though it's right there in the file.Causes
ckan install -c
used to work by adding the module from the file into the registry's available modules list and then pretending that you had typedidentifier=version
for that module at the command line. That ceased to be a thing when available modules were divested from the registry, but the command wasn't updated to work with the newer systems.ModuleInstaller.FindRecommendations
tried to find all the dependencies of the changeset, since one of them doesn't exist, which happened after the cursor was set to hourglass and before the progress tab was activated.IRegistryQuerier.CompatibleGameVersions
was usingAvailableByIdentifier
without catching the exceptions it can throw when the mod isn't in the available list.Changes
ckan install
is refactored to operate in terms ofCkanModule
s instead of strings, generated either by looking up the given identifiers in the available modules or by loading them from .ckan files.ckan install
's usage message includes the-c
form and points out that it can handle URLs.ModuleInstaller.FindRecommendations
throws an exception during the install flow, we activate the progress tab so you can see the error and turn off the hourglass cursorIRegistryQuerier.CompatibleGameVersions
catchesAvailableByIdentifier
's exceptions, tries to fall back to installed mods, and just returns the empty string if nothing is found at allFixes #4005.