Skip to content

Commit

Permalink
fix(reporter): Add authors to concluded license in disclosure document
Browse files Browse the repository at this point in the history
Include authors for package dependencies when both `concluded_license`
and `authors` are curated, and ORT is configured with the
`addAuthorsToCopyrights` option enabled. This ensures that package
authors appear under the respective concluded license in the
Disclosure Document.

This behavior applies when the Scanner option `skipConcluded` is
enabled, having the effect that the scan stage is skipped for the
particular package dependency in this case.

Fixes #9599.

Signed-off-by: Wolfgang Klenk <[email protected]>
  • Loading branch information
wkl3nk committed Dec 16, 2024
1 parent 0a226a3 commit 053ada6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions model/src/main/kotlin/licenses/LicenseInfoResolver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ class LicenseInfoResolver(
licenseInfo.concludedLicenseInfo.concludedLicense?.also {
originalExpressions += ResolvedOriginalExpression(expression = it, source = LicenseSource.CONCLUDED)
}

licenseInfo.declaredLicenseInfo.authors.takeIf { it.isNotEmpty() && addAuthorsToCopyrights }?.also {
locations += resolveCopyrightFromAuthors(it)
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions model/src/test/kotlin/licenses/LicenseInfoResolverTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ class LicenseInfoResolverTest : WordSpec({
)
}

"!resolve copyrights from authors in concluded license" {
"resolve copyrights from authors in concluded license" {
// In case of a concluded license (due to a package curation) verify that the authors named
// in the package curation are added as copyright statement under the concluded license
val licenseInfos = listOf(
Expand Down Expand Up @@ -611,7 +611,7 @@ class LicenseInfoResolverTest : WordSpec({
result should containCopyrightStatementsForLicenseExactly("LicenseRef-b")
}

"!not resolve copyrights from authors in concluded license if disabled" {
"not resolve copyrights from authors in concluded license if disabled" {
val licenseInfos = listOf(
createLicenseInfo(
id = pkgId,
Expand Down

0 comments on commit 053ada6

Please sign in to comment.