Skip to content
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

Don't try to install multiple versions of the same mod #3051

Merged
merged 1 commit into from
May 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Core/Relationships/RelationshipResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,19 @@ private void ResolveStanza(IEnumerable<RelationshipDescriptor> stanza, Selection
var descriptor1 = descriptor;
List<CkanModule> candidates = descriptor
.LatestAvailableWithProvides(registry, kspversion, modlist.Values)
.Where(mod => descriptor1.WithinBounds(mod) && MightBeInstallable(mod))
.Where(mod => !modlist.ContainsKey(mod.identifier)
&& descriptor1.WithinBounds(mod)
&& MightBeInstallable(mod))
.ToList();
if (candidates.Count == 0)
{
// Nothing found, try again without mod list
// (conflicts will still be caught below)
candidates = descriptor
.LatestAvailableWithProvides(registry, kspversion)
.Where(mod => descriptor1.WithinBounds(mod) && MightBeInstallable(mod))
.Where(mod => !modlist.ContainsKey(mod.identifier)
&& descriptor1.WithinBounds(mod)
&& MightBeInstallable(mod))
.ToList();
}

Expand Down Expand Up @@ -519,7 +523,7 @@ private void Add(CkanModule module, SelectionReason reason)
{
// We should never be adding something twice!
log.ErrorFormat("Assertion failed: Adding {0} twice in relationship resolution", module.identifier);
throw new ArgumentException("Already contains module:" + module.identifier);
throw new ArgumentException("Already contains module: " + module.identifier);
}
modlist.Add(module.identifier, module);
if (!reasons.ContainsKey(module))
Expand Down