Skip to content

Commit

Permalink
dnf sbom: use same logic for our version number too
Browse files Browse the repository at this point in the history
  • Loading branch information
Habbie committed Sep 19, 2024
1 parent 72ae147 commit 4f1655a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builder-support/helpers/generate-sbom-dnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ def generateSBOM(packageName, additionalDeps):
appName = packageName
appInfos = getPackageInformations(pkgDB, packageName)
component = { 'name': appName, 'bom-ref': 'pkg:' + appName, 'type': 'application'}
component['version'] = appInfos.version

if appInfos.release:
component['version'] = (appInfos.version if appInfos.epoch == 0 else str(appInfos.epoch) + ':' + appInfos.version) + '-' + appInfos.release
else:
component['version'] = (appInfos.version if appInfos.epoch == 0 else str(appInfos.epoch) + ':' + appInfos.version)

component['supplier'] = {'name': appInfos.vendor if appInfos.vendor != '<NULL>' else 'PowerDNS.COM BV', 'url': ['https://www.powerdns.com']}
component['licenses'] = [{'license': {'id': licenseToSPDXIdentifier(appInfos.license)}}]
depRelations['pkg:' + appName] = []
Expand Down

0 comments on commit 4f1655a

Please sign in to comment.