Skip to content

Commit

Permalink
Merge #3858 More flexible SpaceWarp dependency checking
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jul 20, 2023
2 parents 24a3530 + b4769a7 commit 05a67aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ All notable changes to this project will be documented in this file.

### Internal

- [Netkan] Warnings for missing swinfo.json deps (#3827 by: HebaruSan)
- [Netkan] Warnings for missing swinfo.json deps (#3827, #3858 by: HebaruSan)
- [Build] Stop building on Mono 6.6 and earlier (#3832 by: HebaruSan)
- [Netkan] Add download link to staging PRs (#3831 by: HebaruSan)
- [Netkan] Clarify remote swinfo network errors (#3843 by: HebaruSan; reviewed: )
Expand Down
11 changes: 8 additions & 3 deletions Netkan/Transformers/SpaceWarpInfoTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ public IEnumerable<Metadata> Transform(Metadata metadata, TransformOptions opts)
var moduleDeps = mod.depends.Select(r => (r as ModuleRelationshipDescriptor)?.name)
.Where(ident => ident != null)
.ToHashSet();
var missingDeps = swinfo.dependencies.Select(dep => dep.id)
.Except(moduleDeps)
.ToList();
var missingDeps = swinfo.dependencies
.Select(dep => dep.id)
.Where(depId => !moduleDeps.Contains(
// Remove up to last period
depId.Substring(depId.LastIndexOf('.') + 1),
// Case insensitive
StringComparer.InvariantCultureIgnoreCase))
.ToList();
if (missingDeps.Any())
{
log.WarnFormat("Dependencies from swinfo.json missing from module: {0}",
Expand Down

0 comments on commit 05a67aa

Please sign in to comment.