Skip to content

Commit

Permalink
fix: fix issue with setting external references (in bom granularity)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-graf committed Jan 29, 2025
1 parent 779ec2f commit 9924eaf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
to SPECIFIC of to the value given by `-pms`. Now **existing** Project Mainline States are kept.
* `project create` has a new parameter `--copy_from` which allows to first create a copy of the given
project and then update the releases based on the contents of the given SBOM.
* fix for `bom map` losing SBOM items when it tries to map to invalid SW360 releases
* fix for `bom map` losing SBOM items when it tries to map to invalid SW360 releases.
* fix issue with setting external references (in `bom granularity`).

## 2.6.0

Expand Down
16 changes: 11 additions & 5 deletions capycli/common/capycli_bom_support.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -------------------------------------------------------------------------------
# Copyright (c) 2023-2024 Siemens
# Copyright (c) 2023-2025 Siemens
# All Rights Reserved.
# Author: [email protected]
#
Expand Down Expand Up @@ -124,10 +124,16 @@ def get_ext_ref(comp: Component, type: ExternalReferenceType, comment: str) -> O
@staticmethod
def set_ext_ref(comp: Component, type: ExternalReferenceType, comment: str, value: str,
hash_algo: str = "", hash: str = "") -> None:
ext_ref = ExternalReference(
type=type,
url=XsUri(value),
comment=comment)
if isinstance(value, XsUri):
ext_ref = ExternalReference(
type=type,
url=value,
comment=comment)
else:
ext_ref = ExternalReference(
type=type,
url=XsUri(value),
comment=comment)

if hash_algo and hash:
ext_ref.hashes.add(HashType(
Expand Down

0 comments on commit 9924eaf

Please sign in to comment.