Skip to content

Commit

Permalink
Fix error if there aren't summary & description (using --rpm-package-…
Browse files Browse the repository at this point in the history
…hash)
  • Loading branch information
KAWAHARA-souta committed Jun 27, 2024
1 parent 0e4f9be commit 8aab44e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion libsbom/cyclonedx.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ def __generate_package_component(self, comp):
self.__generate_prop(prop) for prop in comp['properties']
],
licenses=self.__generate_licenses(comp['licenses'])
if 'licenses' in comp and comp['licenses'] else [] ,
if 'licenses' in comp and comp['licenses'] else None ,
description=comp['description']
if 'description' in comp and comp['description'] else None ,
)

def generate_build_sbom(self):
Expand Down
6 changes: 4 additions & 2 deletions libsbom/spdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ def add_package(self, component, build):
# pass
# pkg.license_info_from_files = l

pkg.summary = component['summary']
pkg.description = component['description']
if 'summary' in component and component['summary']:
pkg.summary = component['summary']
if 'description' in component and component['description']:
pkg.description = component['description']

self._document.packages += [pkg]
self._document.relationships += [rel]
Expand Down

0 comments on commit 8aab44e

Please sign in to comment.