Skip to content

Commit

Permalink
Ignore conflicts between versions of same mod
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Apr 27, 2018
1 parent 29c8025 commit 50a8056
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Core/Relationships/SanityChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,15 @@ public static List<KeyValuePair<CkanModule, RelationshipDescriptor>> FindConflic
IDictionary<string, UnmanagedModuleVersion> dlc
)
{
modules = modules?.AsCollection();

var confl = new List<KeyValuePair<CkanModule, RelationshipDescriptor>>();

if (modules != null)
{
foreach (var m in modules.Where(m => m.conflicts != null))
foreach (CkanModule m in modules.Where(m => m.conflicts != null))
{
// Remove self from the list, so we're only comparing to OTHER modules
var others = modules.Where(other => !ReferenceEquals(other, m)).AsCollection();

foreach (var dep in m.conflicts)
// Remove self from the list, so we're only comparing to OTHER modules.
// Also remove other versions of self, to avoid conflicts during upgrades.
var others = modules.Where(other => other.identifier != m.identifier);
foreach (RelationshipDescriptor dep in m.conflicts)
{
if (dep.MatchesAny(others, dlls, dlc))
{
Expand All @@ -152,7 +149,6 @@ IDictionary<string, UnmanagedModuleVersion> dlc
}
}
}

return confl;
}

Expand Down

0 comments on commit 50a8056

Please sign in to comment.