Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spelling with respect to json schema validation #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Synopsys Black Duck - bd_export_spdx22_json.py v0.24

# DEPRECATION NOTICE
This project is no longer maintained and is archived.
The functionality of this script has been superceded by features in standard Black Duck, which should be used for SPDX export going forward. SPDX and CycloneDX export is supported within Project Versions under the Report tab.


# OVERVIEW

This script is provided under an OSS license (specified in the LICENSE file) to allow users to export SPDX version 2.2 in JSON format from Black Duck projects.
Expand Down
8 changes: 4 additions & 4 deletions export_spdx/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def process_comp(comps_dict, tcomp, comp_data_dict):
packagesuppliername = packagesuppliername + "NOASSERTION"

# TO DO - use packagesuppliername somewhere

component_version_ref = tcomp['componentVersion'].split('/')[-1]
thisdict = {
"SPDXID": spdx.quote(spdxpackage_name),
"SPDXID": 'SPDXRef-package-' + component_version_ref,
"name": spdx.quote(tcomp['componentName']),
"versionInfo": spdx.quote(tcomp['componentVersionName']),
"packageFileName": spdx.quote(package_file),
Expand Down Expand Up @@ -526,8 +526,8 @@ async def async_get_licenses(session, lcomp, token):
else:
# Custom license
try:
thislic = 'LicenseRef-' + spdx.clean_for_spdx(lic['licenseDisplay'] + '-' + lcomp['componentName'])
lic_ref = lic['license'].split("/")[-1]
thislic = 'LicenseRef-' + lic_ref
headers = {
'accept': "text/plain",
'Authorization': f'Bearer {token}',
Expand All @@ -539,7 +539,7 @@ async def async_get_licenses(session, lcomp, token):
lic_text = await resp.text('utf-8')
if thislic not in globals.spdx_lics:
mydict = {
'licenseID': spdx.quote(thislic),
'licenseId': spdx.quote(thislic),
'extractedText': spdx.quote(lic_text)
}
globals.spdx["hasExtractedLicensingInfos"].append(mydict)
Expand Down