From 3b4f7537c1eb21b3744746f5584a440be35a8e6d Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Mon, 4 Oct 2021 10:20:28 +0200 Subject: [PATCH] Add NOASSERTION (#41) --- src/identifiers.rs | 1 + tests/check.rs | 8 ++++++++ update/src/main.rs | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/src/identifiers.rs b/src/identifiers.rs index b6b5503..1cb73c4 100644 --- a/src/identifiers.rs +++ b/src/identifiers.rs @@ -1165,6 +1165,7 @@ pub const LICENSES: &[(&str, &str, u8)] = &[ 0x0, ), ("NLPL", r#"No Limit Public License"#, 0x0), + ("NOASSERTION", r#"NOASSERTION"#, 0x0), ("NOSL", r#"Netizen Open Source License"#, IS_FSF_LIBRE), ( "NPL-1.0", diff --git a/tests/check.rs b/tests/check.rs index 4a89d07..3368558 100644 --- a/tests/check.rs +++ b/tests/check.rs @@ -247,3 +247,11 @@ fn gfdl() { false => |req| exact!(req, "GFDL-1.3-invariants"), ]); } + +#[test] +fn noassertion() { + check!("NOASSERTION AND OpenSSL" => [ + true && false => |req| exact!(req, "NOASSERTION") || exact!(req, "MIT"), + true && true => |req| exact!(req, "NOASSERTION") || exact!(req, "OpenSSL"), + ]); +} diff --git a/update/src/main.rs b/update/src/main.rs index ff1aee8..23c00f7 100644 --- a/update/src/main.rs +++ b/update/src/main.rs @@ -210,6 +210,11 @@ pub const IS_GNU: u8 = 0x10; } } + let name = "NOASSERTION".to_owned(); + // Add NOASSERTION, which is not yet? part of the SPDX spec + // https://github.com/spdx/spdx-spec/issues/50 + v.push(("NOASSERTION".to_owned(), &name, "0x0".to_owned())); + v.sort_by(|a, b| a.0.cmp(&b.0)); let lic_list_ver = get(&json, "licenseListVersion")?;