Skip to content

Commit

Permalink
unflatten SHA1 checksum to package["sha1"]
Browse files Browse the repository at this point in the history
  • Loading branch information
dholth committed Nov 15, 2021
1 parent bb5c90d commit a3b4276
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spdx/parsers/jsonyamlxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1505,10 +1505,13 @@ def unflatten_document(document):
packages = document.pop("packages")
for package in packages:
if "hasFiles" in package:

package["files"] = [{
"File": files_by_id[spdxid]} for spdxid in package["hasFiles"]
]
for checksum in package["checksums"]:
if checksum["algorithm"] == "SHA1":
package["sha1"] = checksum["checksumValue"]
break

document["documentDescribes"] = [{ "Package": package} for package in packages ]

Expand Down

0 comments on commit a3b4276

Please sign in to comment.