Skip to content

Commit e3da798

Browse files
porsche-rbienieksschuberth
authored andcommitted
model: Introduce a new copyright holder field to data model
In German law, the author and the copyright holder can be two seperate legal entities and therefore also need to be treated separately. Introduce a new copyright holder field that is now the primary source for copyright holder information. Authors are still only used as copyright holders if the `addAuthorsToCopyrights` option is enabled. For now, all package manager implementations set empty copyright holders. Filling the copyright holder field is left as an exercise for future actions. Right now, the only way to add copyright holders is via curations. This change resolves #4519. Signed-off-by: Rainer Bieniek <extern.rainer.bieniek@porsche.de>
1 parent 65c1565 commit e3da798

33 files changed

+174
-21
lines changed

analyzer/src/funTest/kotlin/managers/SpdxDocumentFileFunTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class SpdxDocumentFileFunTest : WordSpec({
104104
cpe = "cpe:2.3:a:http:curl:7.70.0:*:*:*:*:*:*:*",
105105
definitionFilePath = vcsDir.getPathToRoot(curlPackageFile),
106106
authors = sortedSetOf("Daniel Stenberg (daniel@haxx.se)"),
107+
copyrightHolders = sortedSetOf(),
107108
declaredLicenses = sortedSetOf("curl"),
108109
vcs = VcsInfo(
109110
type = VcsType.GIT,
@@ -125,6 +126,7 @@ class SpdxDocumentFileFunTest : WordSpec({
125126
cpe = "cpe:2.3:a:a-name:openssl:1.1.1g:*:*:*:*:*:*:*",
126127
definitionFilePath = vcsDir.getPathToRoot(opensslPackageFile),
127128
authors = sortedSetOf("OpenSSL Development Team"),
129+
copyrightHolders = sortedSetOf(),
128130
declaredLicenses = sortedSetOf("Apache-2.0"),
129131
vcs = VcsInfo(
130132
type = VcsType.GIT,
@@ -146,6 +148,7 @@ class SpdxDocumentFileFunTest : WordSpec({
146148
cpe = "cpe:/a:compress:zlib:1.2.11:::en-us",
147149
definitionFilePath = vcsDir.getPathToRoot(zlibPackageFile),
148150
authors = sortedSetOf("Jean-loup Gailly", "Mark Adler"),
151+
copyrightHolders = sortedSetOf(),
149152
declaredLicenses = sortedSetOf("Zlib"),
150153
vcs = VcsInfo(
151154
type = VcsType.GIT,

analyzer/src/main/kotlin/managers/Bower.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class Bower(
117117
Package(
118118
id = parsePackageId(node),
119119
authors = parseAuthors(node),
120+
copyrightHolders = sortedSetOf(),
120121
declaredLicenses = parseDeclaredLicenses(node),
121122
description = node["pkgMeta"]["description"].textValueOrEmpty(),
122123
homepageUrl = node["pkgMeta"]["homepage"].textValueOrEmpty(),
@@ -252,6 +253,7 @@ class Bower(
252253
id = projectPackage.id,
253254
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
254255
authors = projectPackage.authors,
256+
copyrightHolders = sortedSetOf(),
255257
declaredLicenses = projectPackage.declaredLicenses,
256258
vcs = projectPackage.vcs,
257259
vcsProcessed = processProjectVcs(workingDir, projectPackage.vcs, projectPackage.homepageUrl),

analyzer/src/main/kotlin/managers/Bundler.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class Bundler(
165165
id = projectId,
166166
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
167167
authors = authors,
168+
copyrightHolders = sortedSetOf(),
168169
declaredLicenses = declaredLicenses.toSortedSet(),
169170
vcs = VcsInfo.EMPTY,
170171
vcsProcessed = processProjectVcs(workingDir, VcsInfo.EMPTY, homepageUrl),
@@ -281,6 +282,7 @@ class Bundler(
281282
return Package(
282283
id = gemId,
283284
authors = gemSpec.authors,
285+
copyrightHolders = sortedSetOf(),
284286
declaredLicenses = gemSpec.declaredLicenses,
285287
description = gemSpec.description,
286288
homepageUrl = gemSpec.homepageUrl,

analyzer/src/main/kotlin/managers/Cargo.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ class Cargo(
220220
id = projectPkg.id,
221221
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
222222
authors = authors,
223+
copyrightHolders = sortedSetOf(),
223224
declaredLicenses = projectPkg.declaredLicenses,
224225
declaredLicensesProcessed = processDeclaredLicenses(projectPkg.declaredLicenses),
225226
vcs = projectPkg.vcs,
@@ -275,6 +276,7 @@ private fun parsePackage(node: JsonNode, hashes: Map<String, String>): Package {
275276
return Package(
276277
id = parsePackageId(node),
277278
authors = parseAuthors(node["authors"]),
279+
copyrightHolders = sortedSetOf(),
278280
declaredLicenses = declaredLicenses,
279281
declaredLicensesProcessed = declaredLicensesProcessed,
280282
description = node["description"].textValueOrEmpty(),

analyzer/src/main/kotlin/managers/Carthage.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class Carthage(
8282
),
8383
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
8484
authors = sortedSetOf(),
85+
copyrightHolders = sortedSetOf(),
8586
declaredLicenses = sortedSetOf(),
8687
vcs = VcsInfo.EMPTY,
8788
vcsProcessed = processProjectVcs(workingDir, VcsInfo.EMPTY),
@@ -190,6 +191,7 @@ class Carthage(
190191
version = revision
191192
),
192193
authors = sortedSetOf(),
194+
copyrightHolders = sortedSetOf(),
193195
declaredLicenses = sortedSetOf(),
194196
description = "",
195197
homepageUrl = projectUrl.removeSuffix(".git"),
@@ -214,6 +216,7 @@ class Carthage(
214216
version = revision
215217
),
216218
authors = sortedSetOf(),
219+
copyrightHolders = sortedSetOf(),
217220
declaredLicenses = sortedSetOf(),
218221
description = "",
219222
homepageUrl = "",
@@ -232,6 +235,7 @@ class Carthage(
232235
version = revision
233236
),
234237
authors = sortedSetOf(),
238+
copyrightHolders = sortedSetOf(),
235239
declaredLicenses = sortedSetOf(),
236240
description = "",
237241
homepageUrl = "",

analyzer/src/main/kotlin/managers/CocoaPods.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ class CocoaPods(
159159
),
160160
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
161161
authors = sortedSetOf(),
162+
copyrightHolders = sortedSetOf(),
162163
declaredLicenses = sortedSetOf(),
163164
vcs = VcsInfo.EMPTY,
164165
vcsProcessed = processProjectVcs(workingDir),
@@ -189,6 +190,7 @@ class CocoaPods(
189190
return Package(
190191
id = id,
191192
authors = sortedSetOf(),
193+
copyrightHolders = sortedSetOf(),
192194
declaredLicenses = podspec.license.takeUnless { it.isEmpty() }?.let { sortedSetOf(it) } ?: sortedSetOf(),
193195
description = podspec.summary,
194196
homepageUrl = podspec.homepage,

analyzer/src/main/kotlin/managers/Composer.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ class Composer(
236236
),
237237
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
238238
authors = parseAuthors(json),
239+
copyrightHolders = sortedSetOf(),
239240
declaredLicenses = parseDeclaredLicenses(json),
240241
vcs = vcs,
241242
vcsProcessed = processProjectVcs(definitionFile.parentFile, vcs, homepageUrl),
@@ -268,6 +269,7 @@ class Composer(
268269
version = version
269270
),
270271
authors = parseAuthors(pkgInfo),
272+
copyrightHolders = sortedSetOf(),
271273
declaredLicenses = parseDeclaredLicenses(pkgInfo),
272274
description = pkgInfo["description"].textValueOrEmpty(),
273275
homepageUrl = homepageUrl,

analyzer/src/main/kotlin/managers/Conan.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ class Conan(
171171
id = projectPackage.id,
172172
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
173173
authors = projectPackage.authors,
174+
copyrightHolders = sortedSetOf(),
174175
declaredLicenses = projectPackage.declaredLicenses,
175176
vcs = projectPackage.vcs,
176177
vcsProcessed = processProjectVcs(
@@ -290,6 +291,7 @@ class Conan(
290291
return Package(
291292
id = id,
292293
authors = parseAuthors(node),
294+
copyrightHolders = sortedSetOf(),
293295
declaredLicenses = parseDeclaredLicenses(node),
294296
description = parsePackageField(node, workingDir, "description"),
295297
homepageUrl = homepageUrl,
@@ -429,6 +431,7 @@ class Conan(
429431
version = inspectField(definitionFile.name, workingDir, "version")
430432
),
431433
authors = parseAuthors(node),
434+
copyrightHolders = sortedSetOf(),
432435
declaredLicenses = parseDeclaredLicenses(node),
433436
description = inspectField(definitionFile.name, workingDir, "description"),
434437
homepageUrl = node["homepage"].textValueOrEmpty(),
@@ -449,6 +452,7 @@ class Conan(
449452
version = ""
450453
),
451454
authors = parseAuthors(node),
455+
copyrightHolders = sortedSetOf(),
452456
declaredLicenses = parseDeclaredLicenses(node),
453457
description = "",
454458
homepageUrl = node["homepage"].textValueOrEmpty(),

analyzer/src/main/kotlin/managers/GoDep.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class GoDep(
136136
val pkg = Package(
137137
id = Identifier("Go", "", name, normalizeModuleVersion(version)),
138138
authors = sortedSetOf(),
139+
copyrightHolders = sortedSetOf(),
139140
declaredLicenses = sortedSetOf(),
140141
description = "",
141142
homepageUrl = "",
@@ -175,6 +176,7 @@ class GoDep(
175176
),
176177
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
177178
authors = sortedSetOf(),
179+
copyrightHolders = sortedSetOf(),
178180
declaredLicenses = sortedSetOf(),
179181
vcs = VcsInfo.EMPTY,
180182
vcsProcessed = projectVcs,

analyzer/src/main/kotlin/managers/GoMod.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class GoMod(
133133
),
134134
definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path,
135135
authors = sortedSetOf(), // Go mod doesn't support author information.
136+
copyrightHolders = sortedSetOf(), // Go mod doesn't support copyright holders.
136137
declaredLicenses = sortedSetOf(), // Go mod doesn't support declared licenses.
137138
vcs = projectVcs,
138139
vcsProcessed = projectVcs,
@@ -284,6 +285,7 @@ class GoMod(
284285
return Package(
285286
id = toId(),
286287
authors = sortedSetOf(), // Go mod doesn't support author information.
288+
copyrightHolders = sortedSetOf(), // Go mod doesn't support copyright holders
287289
declaredLicenses = sortedSetOf(), // Go mod doesn't support declared licenses.
288290
description = "",
289291
homepageUrl = "",

0 commit comments

Comments
 (0)