Skip to content

Commit

Permalink
CuratedPackage: Ensure toUncuratedPackage() clears the concluded license
Browse files Browse the repository at this point in the history
The data model of `PackageCurationResult` is ambiguous. It is not
possible to derive the original concluded license from the list of
`PackageCurationResult`s even if `Package.diff()` was adjusted to handle
the concluded license, see also [1].

Work around that issue by just clearing the concluded license.

[1] #5637

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Aug 22, 2022
1 parent 3810cd3 commit 30ddfed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion model/src/main/kotlin/CuratedPackage.kt
Expand Up @@ -54,7 +54,13 @@ data class CuratedPackage(
curation.base.apply(current)
}.pkg.copy(
// The declared license mapping cannot be reversed as it is additive.
declaredLicensesProcessed = DeclaredLicenseProcessor.process(pkg.declaredLicenses)
declaredLicensesProcessed = DeclaredLicenseProcessor.process(pkg.declaredLicenses),

// It is not possible to derive the original concluded license value with the above reversed application
// of the base curations, even if the function Package.diff() was extended to handle the concluded license,
// see also https://github.com/oss-review-toolkit/ort/issues/5637. Until this is fixed just set the
// concluded license to null, because an un-curated package cannot have a non-null concluded license.
concludedLicense = null
)

@JsonIgnore
Expand Down

0 comments on commit 30ddfed

Please sign in to comment.