summaryrefslogtreecommitdiffstats
path: root/meta/classes/create-spdx-2.2.bbclass
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2024-09-27 09:51:55 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-09-30 17:07:18 +0100
commit07836a96845bad998a803aedf6b3a6d80445f211 (patch)
tree3e0a08411f5aaa4a35bfb219a3830565f9d32878 /meta/classes/create-spdx-2.2.bbclass
parent98e71107d7cfca992040ebbd85c24d8bbf50fc0c (diff)
downloadpoky-07836a96845bad998a803aedf6b3a6d80445f211.tar.gz
spdx 3.0: Map gitsm URI to git
"gitsm" is not a recognized URI protocol (outside of bitbake), so map it to "git" when writing. This should be OK since we report all of the submodule source code (if enabled), and it's still possible for 3rd party analyzers to determine that submodules are in use by looking at .gitmodules. The code to do the mapping is moved to a common location so it covers SPDX 2.2 also [YOCTO #15582] (From OE-Core rev: 6ecf89c75b1a74515266085acc5d3621a0fb2fa1) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/create-spdx-2.2.bbclass')
-rw-r--r--meta/classes/create-spdx-2.2.bbclass11
1 files changed, 1 insertions, 10 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass
index 795ba1a882..cd1d6819bf 100644
--- a/meta/classes/create-spdx-2.2.bbclass
+++ b/meta/classes/create-spdx-2.2.bbclass
@@ -354,15 +354,6 @@ def add_download_packages(d, doc, recipe):
354 if f.type == "file": 354 if f.type == "file":
355 continue 355 continue
356 356
357 uri = f.type
358 proto = getattr(f, "proto", None)
359 if proto is not None:
360 uri = uri + "+" + proto
361 uri = uri + "://" + f.host + f.path
362
363 if f.method.supports_srcrev():
364 uri = uri + "@" + f.revisions[name]
365
366 if f.method.supports_checksum(f): 357 if f.method.supports_checksum(f):
367 for checksum_id in CHECKSUM_LIST: 358 for checksum_id in CHECKSUM_LIST:
368 if checksum_id.upper() not in oe.spdx.SPDXPackage.ALLOWED_CHECKSUMS: 359 if checksum_id.upper() not in oe.spdx.SPDXPackage.ALLOWED_CHECKSUMS:
@@ -377,7 +368,7 @@ def add_download_packages(d, doc, recipe):
377 c.checksumValue = expected_checksum 368 c.checksumValue = expected_checksum
378 package.checksums.append(c) 369 package.checksums.append(c)
379 370
380 package.downloadLocation = uri 371 package.downloadLocation = oe.spdx_common.fetch_data_to_uri(f, name)
381 doc.packages.append(package) 372 doc.packages.append(package)
382 doc.add_relationship(doc, "DESCRIBES", package) 373 doc.add_relationship(doc, "DESCRIBES", package)
383 # In the future, we might be able to do more fancy dependencies, 374 # In the future, we might be able to do more fancy dependencies,