Skip to content

Commit

Permalink
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
1 parent 92bb9af commit b3a8861
Showing 1 changed file with 13 additions and 0 deletions.
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 b3a8861

Please sign in to comment.