diff options
| -rw-r--r-- | meta/classes/cve-check.bbclass | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass index c74c717235..24ddb865ea 100644 --- a/meta/classes/cve-check.bbclass +++ b/meta/classes/cve-check.bbclass | |||
| @@ -121,10 +121,11 @@ python cve_save_summary_handler () { | |||
| 121 | 121 | ||
| 122 | if cve_summary_file and os.path.exists(cve_summary_file): | 122 | if cve_summary_file and os.path.exists(cve_summary_file): |
| 123 | cvefile_link = os.path.join(cvelogpath, cve_summary_name) | 123 | cvefile_link = os.path.join(cvelogpath, cve_summary_name) |
| 124 | 124 | # if the paths are the same don't create the link | |
| 125 | if os.path.exists(os.path.realpath(cvefile_link)): | 125 | if cvefile_link != cve_summary_file: |
| 126 | os.remove(cvefile_link) | 126 | if os.path.exists(os.path.realpath(cvefile_link)): |
| 127 | os.symlink(os.path.basename(cve_summary_file), cvefile_link) | 127 | os.remove(cvefile_link) |
| 128 | os.symlink(os.path.basename(cve_summary_file), cvefile_link) | ||
| 128 | 129 | ||
| 129 | json_summary_link_name = os.path.join(cvelogpath, d.getVar("CVE_CHECK_SUMMARY_FILE_NAME_JSON")) | 130 | json_summary_link_name = os.path.join(cvelogpath, d.getVar("CVE_CHECK_SUMMARY_FILE_NAME_JSON")) |
| 130 | json_summary_name = os.path.join(cvelogpath, "%s-%s.json" % (cve_summary_name, timestamp)) | 131 | json_summary_name = os.path.join(cvelogpath, "%s-%s.json" % (cve_summary_name, timestamp)) |
| @@ -198,10 +199,12 @@ python cve_check_write_rootfs_manifest () { | |||
| 198 | 199 | ||
| 199 | if manifest_name and os.path.exists(manifest_name): | 200 | if manifest_name and os.path.exists(manifest_name): |
| 200 | manifest_link = os.path.join(deploy_dir, "%s.cve" % link_name) | 201 | manifest_link = os.path.join(deploy_dir, "%s.cve" % link_name) |
| 201 | # If we already have another manifest, update symlinks | 202 | # if they are the same don't create the link |
| 202 | if os.path.exists(os.path.realpath(manifest_link)): | 203 | if manifest_link != manifest_name: |
| 203 | os.remove(manifest_link) | 204 | # If we already have another manifest, update symlinks |
| 204 | os.symlink(os.path.basename(manifest_name), manifest_link) | 205 | if os.path.exists(os.path.realpath(manifest_link)): |
| 206 | os.remove(manifest_link) | ||
| 207 | os.symlink(os.path.basename(manifest_name), manifest_link) | ||
| 205 | bb.plain("Image CVE report stored in: %s" % manifest_name) | 208 | bb.plain("Image CVE report stored in: %s" % manifest_name) |
| 206 | 209 | ||
| 207 | link_path = os.path.join(deploy_dir, "%s.json" % link_name) | 210 | link_path = os.path.join(deploy_dir, "%s.json" % link_name) |
