Skip to content

Commit

Permalink
Merge #3827 Warnings for missing swinfo.json deps
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Apr 18, 2023
2 parents 92bb9af + b3a8861 commit 4aa4db6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file.

- [GUI] Only update Versions tab when the mod changes (#3822 by: HebaruSan; reviewed: techman83)

### Internal

- [Netkan] Warnings for missing swinfo.json deps (#3827 by: HebaruSan)

## v1.32.0 (Kepler)

### Features
Expand Down
13 changes: 13 additions & 0 deletions Netkan/Transformers/SpaceWarpInfoTransformer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

using ICSharpCode.SharpZipLib.Zip;
using log4net;
Expand All @@ -10,6 +11,7 @@
using CKAN.NetKAN.Services;
using CKAN.NetKAN.Extensions;
using CKAN.NetKAN.Sources.Github;
using CKAN.Extensions;
using CKAN.Versioning;
using CKAN.Games;

Expand Down Expand Up @@ -74,6 +76,17 @@ public IEnumerable<Metadata> Transform(Metadata metadata, TransformOptions opts)
log.InfoFormat("Found compatibility: {0}–{1}", minVer, maxVer);
ModuleService.ApplyVersions(json, null, minVer, maxVer);
}
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();
if (missingDeps.Any())
{
log.WarnFormat("Dependencies from swinfo.json missing from module: {0}",
string.Join(", ", missingDeps));
}
log.DebugFormat("Transformed metadata:{0}{1}",
Environment.NewLine, json);
yield return new Metadata(json);
Expand Down

0 comments on commit 4aa4db6

Please sign in to comment.