Skip to content

Commit 632dcb4

Browse files
committed
Remove the feature to add authors to copyrights
The feature was a crude way to curate copyright statements by curating authors and enabling the addition of authors as copyrights (with a missing year even). That appraoch does not work if authors and copyrights need to stay separate, as e.g. by German law not every author is a copyright holder. So remove this feature in favor of an upcoming change that introduces proper and dedicated curations for concluded copyright statements. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
1 parent d3e989e commit 632dcb4

File tree

13 files changed

+1
-123
lines changed

13 files changed

+1
-123
lines changed

cli/src/main/kotlin/commands/EvaluatorCommand.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ class EvaluatorCommand : CliktCommand(name = "evaluate", help = "Evaluate ORT re
302302
val licenseInfoResolver = LicenseInfoResolver(
303303
provider = DefaultLicenseInfoProvider(ortResultInput, packageConfigurationProvider),
304304
copyrightGarbage = copyrightGarbage,
305-
addAuthorsToCopyrights = config.addAuthorsToCopyrights,
306305
archiver = config.scanner.archive.createFileArchiver(),
307306
licenseFilenamePatterns = LicenseFilenamePatterns.getInstance()
308307
)

cli/src/main/kotlin/commands/ReporterCommand.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ class ReporterCommand : CliktCommand(
237237
val licenseInfoResolver = LicenseInfoResolver(
238238
provider = DefaultLicenseInfoProvider(ortResult, packageConfigurationProvider),
239239
copyrightGarbage = copyrightGarbage,
240-
addAuthorsToCopyrights = config.addAuthorsToCopyrights,
241240
archiver = config.scanner.archive.createFileArchiver(),
242241
licenseFilenamePatterns = LicenseFilenamePatterns.getInstance()
243242
)

helper-cli/src/main/kotlin/utils/Extensions.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ internal fun OrtResult.fetchScannedSources(id: Identifier): File {
124124
internal fun OrtResult.processAllCopyrightStatements(
125125
omitExcluded: Boolean = true,
126126
copyrightGarbage: Set<String> = emptySet(),
127-
addAuthorsToCopyrights: Boolean = false,
128127
packageConfigurationProvider: PackageConfigurationProvider = PackageConfigurationProvider.EMPTY
129128
): List<ProcessedCopyrightStatement> {
130129
val result = mutableListOf<ProcessedCopyrightStatement>()
@@ -133,8 +132,7 @@ internal fun OrtResult.processAllCopyrightStatements(
133132

134133
val licenseInfoResolver = createLicenseInfoResolver(
135134
packageConfigurationProvider = packageConfigurationProvider,
136-
copyrightGarbage = CopyrightGarbage(copyrightGarbage.toSortedSet()),
137-
addAuthorsToCopyrights = addAuthorsToCopyrights
135+
copyrightGarbage = CopyrightGarbage(copyrightGarbage.toSortedSet())
138136
)
139137

140138
collectProjectsAndPackages().forEach { id ->

model/src/main/kotlin/config/OrtConfiguration.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ data class OrtConfiguration(
4040
*/
4141
val licenseFilePatterns: LicenseFilenamePatterns = LicenseFilenamePatterns.DEFAULT,
4242

43-
/**
44-
* A flag to indicate whether authors should be considered as copyright holders.
45-
*/
46-
val addAuthorsToCopyrights: Boolean = false,
47-
4843
/**
4944
* The threshold from which on issues count as severe.
5045
*/

model/src/main/kotlin/licenses/DefaultLicenseInfoProvider.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,17 @@ class DefaultLicenseInfoProvider(
6161
private fun createDeclaredLicenseInfo(id: Identifier): DeclaredLicenseInfo =
6262
ortResult.getProject(id)?.let { project ->
6363
DeclaredLicenseInfo(
64-
authors = project.authors,
6564
licenses = project.declaredLicenses,
6665
processed = project.declaredLicensesProcessed,
6766
appliedCurations = emptyList()
6867
)
6968
} ?: ortResult.getPackage(id)?.let { (pkg, curations) ->
7069
DeclaredLicenseInfo(
71-
authors = pkg.authors,
7270
licenses = pkg.declaredLicenses,
7371
processed = pkg.declaredLicensesProcessed,
7472
appliedCurations = curations.filter { it.curation.declaredLicenseMapping.isNotEmpty() }
7573
)
7674
} ?: DeclaredLicenseInfo(
77-
authors = sortedSetOf(),
7875
licenses = emptySet(),
7976
processed = ProcessedDeclaredLicense(null),
8077
appliedCurations = emptyList()

model/src/main/kotlin/licenses/LicenseInfo.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ data class ConcludedLicenseInfo(
7777
* Information about the declared license of a package or project.
7878
*/
7979
data class DeclaredLicenseInfo(
80-
/**
81-
* The set of authors.
82-
*/
83-
val authors: SortedSet<String>,
84-
8580
/**
8681
* The unmodified set of declared licenses.
8782
*/

model/src/main/kotlin/licenses/LicenseInfoResolver.kt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import org.ossreviewtoolkit.utils.spdx.SpdxSingleLicenseExpression
4343
class LicenseInfoResolver(
4444
private val provider: LicenseInfoProvider,
4545
private val copyrightGarbage: CopyrightGarbage,
46-
val addAuthorsToCopyrights: Boolean,
4746
val archiver: FileArchiver?,
4847
val licenseFilenamePatterns: LicenseFilenamePatterns = LicenseFilenamePatterns.DEFAULT
4948
) {
@@ -97,26 +96,6 @@ class LicenseInfoResolver(
9796
originalDeclaredLicenses += licenseInfo.declaredLicenseInfo.processed.mapped.filterValues {
9897
it == license
9998
}.keys
100-
101-
licenseInfo.declaredLicenseInfo.authors.takeIf { it.isNotEmpty() && addAuthorsToCopyrights }?.also {
102-
locations += ResolvedLicenseLocation(
103-
provenance = UnknownProvenance,
104-
location = UNDEFINED_TEXT_LOCATION,
105-
appliedCuration = null,
106-
matchingPathExcludes = emptyList(),
107-
copyrights = it.mapTo(mutableSetOf()) { author ->
108-
val statement = "Copyright (C) $author".takeUnless {
109-
author.contains("Copyright", ignoreCase = true)
110-
} ?: author
111-
112-
ResolvedCopyrightFinding(
113-
statement = statement,
114-
location = UNDEFINED_TEXT_LOCATION,
115-
matchingPathExcludes = emptyList()
116-
)
117-
}
118-
)
119-
}
12099
}
121100
}
122101

model/src/main/kotlin/utils/OrtResultExtensions.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ import org.ossreviewtoolkit.model.licenses.LicenseInfoResolver
3434
fun OrtResult.createLicenseInfoResolver(
3535
packageConfigurationProvider: PackageConfigurationProvider = PackageConfigurationProvider.EMPTY,
3636
copyrightGarbage: CopyrightGarbage = CopyrightGarbage(),
37-
addAuthorsToCopyrights: Boolean = false,
3837
archiver: FileArchiver? = null
3938
) = LicenseInfoResolver(
4039
DefaultLicenseInfoProvider(this, packageConfigurationProvider),
4140
copyrightGarbage,
42-
addAuthorsToCopyrights,
4341
archiver,
4442
LicenseFilenamePatterns.getInstance()
4543
)

model/src/test/kotlin/licenses/DefaultLicenseInfoProviderTest.kt

Lines changed: 0 additions & 39 deletions
This file was deleted.

model/src/test/kotlin/licenses/LicenseInfoResolverTest.kt

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -546,42 +546,6 @@ class LicenseInfoResolverTest : WordSpec({
546546
result should containNumberOfLocationsForLicense(gplLicense, 2)
547547
result should containNumberOfLocationsForLicense(bsdLicense, 4)
548548
}
549-
550-
"resolve copyrights from authors if enabled" {
551-
val licenseInfos = listOf(
552-
createLicenseInfo(
553-
id = pkgId,
554-
authors = authors,
555-
declaredLicenses = declaredLicenses
556-
)
557-
)
558-
val resolver = createResolver(licenseInfos, addAuthorsToCopyrights = true)
559-
560-
val result = resolver.resolveLicenseInfo(pkgId)
561-
result should containCopyrightStatementsForLicenseExactly(
562-
"LicenseRef-a",
563-
"Copyright (C) The Author", "Copyright (C) The Other Author"
564-
)
565-
result should containCopyrightStatementsForLicenseExactly(
566-
"LicenseRef-b",
567-
"Copyright (C) The Author", "Copyright (C) The Other Author"
568-
)
569-
}
570-
571-
"not resolve copyrights from authors if disabled" {
572-
val licenseInfos = listOf(
573-
createLicenseInfo(
574-
id = pkgId,
575-
authors = authors,
576-
declaredLicenses = declaredLicenses
577-
)
578-
)
579-
val resolver = createResolver(licenseInfos, addAuthorsToCopyrights = false)
580-
581-
val result = resolver.resolveLicenseInfo(pkgId)
582-
result should containCopyrightStatementsForLicenseExactly("LicenseRef-a")
583-
result should containCopyrightStatementsForLicenseExactly("LicenseRef-b")
584-
}
585549
}
586550

587551
"resolveLicenseFiles()" should {
@@ -652,26 +616,22 @@ class LicenseInfoResolverTest : WordSpec({
652616
private fun createResolver(
653617
data: List<LicenseInfo>,
654618
copyrightGarbage: Set<String> = emptySet(),
655-
addAuthorsToCopyrights: Boolean = false,
656619
archiver: FileArchiver = FileArchiver.createDefault()
657620
) = LicenseInfoResolver(
658621
provider = SimpleLicenseInfoProvider(data),
659622
copyrightGarbage = CopyrightGarbage(copyrightGarbage.toSortedSet()),
660-
addAuthorsToCopyrights = addAuthorsToCopyrights,
661623
archiver = archiver
662624
)
663625

664626
private fun createLicenseInfo(
665627
id: Identifier,
666-
authors: SortedSet<String> = sortedSetOf(),
667628
declaredLicenses: Set<String> = emptySet(),
668629
detectedLicenses: List<Findings> = emptyList(),
669630
concludedLicense: SpdxExpression? = null
670631
) =
671632
LicenseInfo(
672633
id = id,
673634
declaredLicenseInfo = DeclaredLicenseInfo(
674-
authors = authors,
675635
licenses = declaredLicenses,
676636
processed = DeclaredLicenseProcessor.process(declaredLicenses),
677637
appliedCurations = emptyList()

0 commit comments

Comments
 (0)