Fix the following issues mentioned in Pixel SBOM review.
1) PackageSupplier should be NOASSERTION if there is no homepage
information in METADATA file of source packages
2) PackageDownloadLocation of upstream packages should be NOASSERTION if
there is no code repository URL in METADATA file of source packages
Test: CIs
Test: atest --host sbom_writers_test
Change-Id: I8a0298b7bacc2f96555f9d7dde0d21ada8c6b564
diff --git a/tools/sbom/sbom_writers.py b/tools/sbom/sbom_writers.py
index 66aa6b4..b1c66c5 100644
--- a/tools/sbom/sbom_writers.py
+++ b/tools/sbom/sbom_writers.py
@@ -86,7 +86,7 @@
@staticmethod
def marshal_package(package):
- download_location = 'NONE'
+ download_location = sbom_data.VALUE_NOASSERTION
if package.download_location:
download_location = package.download_location
tagvalues = [
@@ -296,7 +296,7 @@
package = {
PropNames.NAME: p.name,
PropNames.SPDXID: p.id,
- PropNames.PACKAGE_DOWNLOAD_LOCATION: p.download_location if p.download_location else 'NONE',
+ PropNames.PACKAGE_DOWNLOAD_LOCATION: p.download_location if p.download_location else sbom_data.VALUE_NOASSERTION,
PropNames.FILES_ANALYZED: p.files_analyzed
}
if p.version: