From fd559f89b51de8289109782d57d54f4a1dcc5070 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Fri, 7 Apr 2023 21:35:13 +0000 Subject: [PATCH] Revert "Check if an installed file exists and report error if not." This reverts commit f049389e2e9d2ae378cf5efdb689abe86ffb3adf. Reason for revert: the check includes more files that should not be excluded. Change-Id: I7f7d260218826cc8fd033400b2cfaf40e4c280d0 --- tools/generate-sbom.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/generate-sbom.py b/tools/generate-sbom.py index c22175c9af..eae7945588 100755 --- a/tools/generate-sbom.py +++ b/tools/generate-sbom.py @@ -87,7 +87,6 @@ ISSUE_NO_METADATA = 'No metadata generated in Make for installed files:' ISSUE_NO_METADATA_FILE = 'No METADATA file found for installed file:' ISSUE_METADATA_FILE_INCOMPLETE = 'METADATA file incomplete:' ISSUE_UNKNOWN_SECURITY_TAG_TYPE = 'Unknown security tag type:' -ISSUE_INSTALLED_FILE_NOT_EXIST = 'Non-exist installed files:' INFO_METADATA_FOUND_FOR_PACKAGE = 'METADATA file found for packages:' @@ -598,12 +597,11 @@ def main(): # Report on some issues and information report = { - ISSUE_NO_METADATA: [], - ISSUE_NO_METADATA_FILE: [], - ISSUE_METADATA_FILE_INCOMPLETE: [], - ISSUE_UNKNOWN_SECURITY_TAG_TYPE: [], - ISSUE_INSTALLED_FILE_NOT_EXIST: [], - INFO_METADATA_FOUND_FOR_PACKAGE: [], + ISSUE_NO_METADATA: [], + ISSUE_NO_METADATA_FILE: [], + ISSUE_METADATA_FILE_INCOMPLETE: [], + ISSUE_UNKNOWN_SECURITY_TAG_TYPE: [], + INFO_METADATA_FOUND_FOR_PACKAGE: [] } # Scan the metadata in CSV file and create the corresponding package and file records in SPDX @@ -621,9 +619,6 @@ def main(): if not installed_file_has_metadata(installed_file_metadata, report): continue - if not os.path.isfile(installed_file): - report[ISSUE_INSTALLED_FILE_NOT_EXIST].append(installed_file) - continue file_id = new_file_id(installed_file) product_files.append(new_file_record(file_id, installed_file, checksum(installed_file)))