From 9612d3bc95a3e134990e4c5e4a9c587528508f82 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Wed, 13 May 2020 16:15:17 -0500 Subject: [PATCH] Don't try to install multiple versions of the same mod --- Core/Relationships/RelationshipResolver.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/Relationships/RelationshipResolver.cs b/Core/Relationships/RelationshipResolver.cs index ed66724b32..04cdb6e851 100644 --- a/Core/Relationships/RelationshipResolver.cs +++ b/Core/Relationships/RelationshipResolver.cs @@ -410,7 +410,9 @@ private void ResolveStanza(IEnumerable stanza, Selection var descriptor1 = descriptor; List 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) { @@ -418,7 +420,9 @@ private void ResolveStanza(IEnumerable stanza, Selection // (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(); } @@ -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))