diff --git a/CHANGELOG.md b/CHANGELOG.md index 55d42b29c1..2081bae7cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,8 @@ All notable changes to this project will be documented in this file. ### Internal -- [Tooling] Switch workflows from set-output to `$GITHUB_OUTPUT` (#3696 by: HebaruSan; reviewed: ) +- [Tooling] Switch workflows from set-output to `$GITHUB_OUTPUT` (#3696 by: HebaruSan) +- [Netkan] Fix Netkan check for Ships/Script `spec_version` (#3713 by: HebaruSan; reviewed: techman83) ## v1.31.2 (Juno) diff --git a/Netkan/Validators/InstallValidator.cs b/Netkan/Validators/InstallValidator.cs index afcef9ae63..83e9e298bd 100644 --- a/Netkan/Validators/InstallValidator.cs +++ b/Netkan/Validators/InstallValidator.cs @@ -1,4 +1,7 @@ +using System.Linq; + using Newtonsoft.Json.Linq; + using CKAN.Versioning; using CKAN.NetKAN.Model; @@ -30,7 +33,15 @@ public void Validate(Metadata metadata) { throw new Kraken("spec_version v1.25+ required to install to Missions"); } - if (metadata.SpecVersion < v1p29 && install_to.StartsWith("Ships/Script")) + if (metadata.SpecVersion < v1p29 && ( + install_to.StartsWith("Ships/Script") + || install_to.Equals("Ships") && ( + // find: .../Script, install_to: Ships + ((string)stanza["find"])?.Split(new char[] {'/'})?.LastOrDefault() == "Script" + // file: .../Script, install_to: Ships + || ((string)stanza["file"])?.Split(new char[] {'/'})?.LastOrDefault() == "Script" + // install_to: Ships, as: Script + || (((string)stanza["as"])?.EndsWith("Script") ?? false)))) { throw new Kraken("spec_version v1.29+ required to install to Ships/Script"); }