diff options
| author | Joshua Watt <jpewhacker@gmail.com> | 2024-09-27 09:51:55 -0600 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-09-30 17:07:18 +0100 |
| commit | 07836a96845bad998a803aedf6b3a6d80445f211 (patch) | |
| tree | 3e0a08411f5aaa4a35bfb219a3830565f9d32878 /meta/lib/oe/spdx30_tasks.py | |
| parent | 98e71107d7cfca992040ebbd85c24d8bbf50fc0c (diff) | |
| download | poky-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/lib/oe/spdx30_tasks.py')
| -rw-r--r-- | meta/lib/oe/spdx30_tasks.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py index 70d1bc7e8a..1ae13b4af8 100644 --- a/meta/lib/oe/spdx30_tasks.py +++ b/meta/lib/oe/spdx30_tasks.py | |||
| @@ -379,22 +379,15 @@ def add_download_files(d, objset): | |||
| 379 | inputs.add(file) | 379 | inputs.add(file) |
| 380 | 380 | ||
| 381 | else: | 381 | else: |
| 382 | uri = fd.type | ||
| 383 | proto = getattr(fd, "proto", None) | ||
| 384 | if proto is not None: | ||
| 385 | uri = uri + "+" + proto | ||
| 386 | uri = uri + "://" + fd.host + fd.path | ||
| 387 | |||
| 388 | if fd.method.supports_srcrev(): | ||
| 389 | uri = uri + "@" + fd.revisions[name] | ||
| 390 | |||
| 391 | dl = objset.add( | 382 | dl = objset.add( |
| 392 | oe.spdx30.software_Package( | 383 | oe.spdx30.software_Package( |
| 393 | _id=objset.new_spdxid("source", str(download_idx + 1)), | 384 | _id=objset.new_spdxid("source", str(download_idx + 1)), |
| 394 | creationInfo=objset.doc.creationInfo, | 385 | creationInfo=objset.doc.creationInfo, |
| 395 | name=file_name, | 386 | name=file_name, |
| 396 | software_primaryPurpose=primary_purpose, | 387 | software_primaryPurpose=primary_purpose, |
| 397 | software_downloadLocation=uri, | 388 | software_downloadLocation=oe.spdx_common.fetch_data_to_uri( |
| 389 | fd, name | ||
| 390 | ), | ||
| 398 | ) | 391 | ) |
| 399 | ) | 392 | ) |
| 400 | 393 | ||
