Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## [Unreleased] - ReleaseDate
### Fixed
- [PR#87](https://github.com/EmbarkStudios/spdx/pull/87) fixed a code generation bug introduced in [PR#86](https://github.com/EmbarkStudios/spdx/pull/86) that caused `LicenseId::text()` to return the incorrect license text.

## [0.13.1] - 2025-12-03
### Changed
- [PR#86](https://github.com/EmbarkStudios/spdx/pull/86) changes the license detection for GNU licenses (GPL, AGPL, LGPL, GFDL). In 0.13.0 they would be detected as their deprecated (eg. `AGPL-3.0`) variant due to the variants (root, `-only`, and `-or-later`) using the exact same license text. GNU licenses are now detected as the `<root>-or-later` version. This is an arbitrary decision, which I hope to not change, but if someone makes a convincing argument it could be.
Expand Down
4 changes: 2 additions & 2 deletions src/detection/cache.bin.zstd
Git LFS file not shown
2 changes: 1 addition & 1 deletion src/text.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("NOASSERTION", ""),
("0BSD", include!("text/licenses/0BSD")),
("3D-Slicer-1.0", include!("text/licenses/3D-Slicer-1.0")),
("AAL", include!("text/licenses/AAL")),
Expand Down Expand Up @@ -773,6 +772,7 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("NLOD-1.0", include!("text/licenses/NLOD-1.0")),
("NLOD-2.0", include!("text/licenses/NLOD-2.0")),
("NLPL", include!("text/licenses/NLPL")),
("NOASSERTION", include!("text/licenses/NOASSERTION")),
("NOSL", include!("text/licenses/NOSL")),
("NPL-1.0", include!("text/licenses/NPL-1.0")),
("NPL-1.1", include!("text/licenses/NPL-1.1")),
Expand Down
1 change: 1 addition & 0 deletions src/text/licenses/NOASSERTION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
r#""#
14 changes: 14 additions & 0 deletions tests/spdx_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,17 @@ fn handles_copyleft() {
assert!(gpl.is_copyleft());
assert_eq!(gpl.full_name, "GNU General Public License v3.0 or later");
}

#[test]
#[cfg(feature = "text")]
fn has_correct_license_text() {
let mit = license_id("MIT").unwrap();

assert_eq!(
mit.text(),
spdx::text::LICENSE_TEXTS
.iter()
.find_map(|(name, text)| (*name == "MIT").then_some(*text))
.unwrap()
);
}
2 changes: 1 addition & 1 deletion update/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ fn write_license_texts(
'outer: for license in licenses {
let license = license.as_ref();
if license == "NOASSERTION" {
writeln!(texts, " (\"{license}\", \"\"),")?;
text_map.insert("NOASSERTION".into(), ("".into(), Vec::new()));
continue;
}

Expand Down