Skip to content

Commit

Permalink
Merge #3494 Enforce spec version requirements for more install proper…
Browse files Browse the repository at this point in the history
…ties
  • Loading branch information
HebaruSan committed Jan 3, 2022
2 parents e4a7ea3 + 8865a3f commit 068a8dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ All notable changes to this project will be documented in this file.
- [Netkan] Fix double-absolute SpaceDock URLs (#3466 by: HebaruSan; reviewed: DasSkelett)
- [Netkan] Set bot useragent for Inflator (#3490 by: HebaruSan; reviewed: DasSkelett)
- [Netkan] Sort Netkan warning lists (#3492 by: HebaruSan; reviewed: DasSkelett)
- [Netkan] Enforce spec version requirements for more install properties (#3494 by: HebaruSan; reviewed: techman83)

## v1.30.4 (Hubble)

Expand Down
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 068a8dd

Please sign in to comment.