diff --git a/CHANGELOG.md b/CHANGELOG.md index c39a5dd92d..76023c4b26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Netkan/Transformers/SpaceWarpInfoTransformer.cs b/Netkan/Transformers/SpaceWarpInfoTransformer.cs index eb9f79bf10..a4658e535b 100644 --- a/Netkan/Transformers/SpaceWarpInfoTransformer.cs +++ b/Netkan/Transformers/SpaceWarpInfoTransformer.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using ICSharpCode.SharpZipLib.Zip; using log4net; @@ -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; @@ -74,6 +76,17 @@ public IEnumerable 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);