Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce spec version requirements for more install properties #3494

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions Netkan/Validators/InstallValidator.cs
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