Skip to content

Commit

Permalink
Enforce spec version requirements for more install properties
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Dec 19, 2021
1 parent cafa832 commit 8865a3f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Netkan/Validators/InstallValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ public void Validate(Metadata metadata)
{
throw new Kraken("spec_version v1.10+ required for install with 'find_regexp'");
}
if (metadata.SpecVersion < v1p10 && stanza.ContainsKey("filter_regexp"))
{
throw new Kraken("spec_version v1.10+ required for install with 'filter_regexp'");
}
if (metadata.SpecVersion < v1p24 && stanza.ContainsKey("include_only"))
{
throw new Kraken("spec_version v1.24+ required for install with 'include_only'");
}
if (metadata.SpecVersion < v1p24 && stanza.ContainsKey("include_only_regexp"))
{
throw new Kraken("spec_version v1.24+ required for install with 'include_only_regexp'");
}
if (metadata.SpecVersion < v1p16 && stanza.ContainsKey("find_matches_files"))
{
throw new Kraken("spec_version v1.16+ required for 'find_matches_files'");
Expand Down Expand Up @@ -73,6 +85,7 @@ public void Validate(Metadata metadata)
private static readonly ModuleVersion v1p12 = new ModuleVersion("v1.12");
private static readonly ModuleVersion v1p16 = new ModuleVersion("v1.16");
private static readonly ModuleVersion v1p18 = new ModuleVersion("v1.18");
private static readonly ModuleVersion v1p24 = new ModuleVersion("v1.24");
private static readonly ModuleVersion v1p29 = new ModuleVersion("v1.29");
private static readonly string[] pathProperties = {"find", "file", "install_to"};
}
Expand Down

0 comments on commit 8865a3f

Please sign in to comment.