Don't try to install multiple versions of the same mod #3051
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.
Background
In KSP-CKAN/NetKAN#7891, Spectra removed
PlanetShine-Config
from itsprovides
list because it no longer ships with a PlanetShine config. Versions v1.2.5 and earlier were released before that change, and v1.3 and later were released after.Problem
If you install Spectra v1.3.1 (after the above change):
... and then install the PlanetShine suggestion, you will be prompted to choose between PlanetShine's default config and Spectra v1.2.5:
If you choose Spectra v1.2.5, this fails because you're already installing Spectra v1.3.1, and you can't install two different versions of the same mod at the same time.
Cause
When the
RelationshipResolver
looks for modules to satisfy adepends
relationship,LatestAvailableWithProvides
can find other versions of a mod we're already installing, and it doesn't account for this possibility.Canges
Now we exclude modules if they have the same identifier as one we're already installing. This allows Spectra v1.3.1 to install with the default PlanetShine config without prompting, and Spectra v1.2.5 to install its own PlanetShine config without prompting.