Merge "Check if an installed file exists and report error if not."
This commit is contained in:
commit
bd5a6e882d
1 changed files with 10 additions and 5 deletions
|
@ -87,6 +87,7 @@ ISSUE_NO_METADATA = 'No metadata generated in Make for installed files:'
|
||||||
ISSUE_NO_METADATA_FILE = 'No METADATA file found for installed file:'
|
ISSUE_NO_METADATA_FILE = 'No METADATA file found for installed file:'
|
||||||
ISSUE_METADATA_FILE_INCOMPLETE = 'METADATA file incomplete:'
|
ISSUE_METADATA_FILE_INCOMPLETE = 'METADATA file incomplete:'
|
||||||
ISSUE_UNKNOWN_SECURITY_TAG_TYPE = 'Unknown security tag type:'
|
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:'
|
INFO_METADATA_FOUND_FOR_PACKAGE = 'METADATA file found for packages:'
|
||||||
|
|
||||||
|
|
||||||
|
@ -601,7 +602,8 @@ def main():
|
||||||
ISSUE_NO_METADATA_FILE: [],
|
ISSUE_NO_METADATA_FILE: [],
|
||||||
ISSUE_METADATA_FILE_INCOMPLETE: [],
|
ISSUE_METADATA_FILE_INCOMPLETE: [],
|
||||||
ISSUE_UNKNOWN_SECURITY_TAG_TYPE: [],
|
ISSUE_UNKNOWN_SECURITY_TAG_TYPE: [],
|
||||||
INFO_METADATA_FOUND_FOR_PACKAGE: []
|
ISSUE_INSTALLED_FILE_NOT_EXIST: [],
|
||||||
|
INFO_METADATA_FOUND_FOR_PACKAGE: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scan the metadata in CSV file and create the corresponding package and file records in SPDX
|
# Scan the metadata in CSV file and create the corresponding package and file records in SPDX
|
||||||
|
@ -619,6 +621,9 @@ def main():
|
||||||
|
|
||||||
if not installed_file_has_metadata(installed_file_metadata, report):
|
if not installed_file_has_metadata(installed_file_metadata, report):
|
||||||
continue
|
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)
|
file_id = new_file_id(installed_file)
|
||||||
product_files.append(new_file_record(file_id, installed_file, checksum(installed_file)))
|
product_files.append(new_file_record(file_id, installed_file, checksum(installed_file)))
|
||||||
|
|
Loading…
Reference in a new issue