diff options
author | Marta Rybczynska <rybczynska@gmail.com> | 2022-06-03 10:58:27 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-06-06 13:35:29 +0100 |
commit | debd37abcdde8788761ebdb4a05bc61f7394cbb8 (patch) | |
tree | 0c555292b4a6a948dec03c659ae2dfd79408ffe2 /meta/classes/cve-check.bbclass | |
parent | 1e08da6a43876677ae4481156ce1d7177b77264d (diff) | |
download | openembedded-core-contrib-debd37abcdde8788761ebdb4a05bc61f7394cbb8.tar.gz |
cve-check: move update_symlinks to a library
Move the function to a library, it could be useful in other places.
Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/cve-check.bbclass')
-rw-r--r-- | meta/classes/cve-check.bbclass | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass index c80a365819..3844efcddb 100644 --- a/meta/classes/cve-check.bbclass +++ b/meta/classes/cve-check.bbclass @@ -80,16 +80,10 @@ CVE_CHECK_LAYER_INCLUDELIST ??= "" # set to "alphabetical" for version using single alphabetical character as increment release CVE_VERSION_SUFFIX ??= "" -def update_symlinks(target_path, link_path): - if link_path != target_path and os.path.exists(target_path): - if os.path.exists(os.path.realpath(link_path)): - os.remove(link_path) - os.symlink(os.path.basename(target_path), link_path) - def generate_json_report(d, out_path, link_path): if os.path.exists(d.getVar("CVE_CHECK_SUMMARY_INDEX_PATH")): import json - from oe.cve_check import cve_check_merge_jsons + from oe.cve_check import cve_check_merge_jsons, update_symlinks bb.note("Generating JSON CVE summary") index_file = d.getVar("CVE_CHECK_SUMMARY_INDEX_PATH") @@ -110,6 +104,7 @@ def generate_json_report(d, out_path, link_path): python cve_save_summary_handler () { import shutil import datetime + from oe.cve_check import update_symlinks cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE") @@ -179,7 +174,7 @@ python cve_check_write_rootfs_manifest () { import shutil import json from oe.rootfs import image_list_installed_packages - from oe.cve_check import cve_check_merge_jsons + from oe.cve_check import cve_check_merge_jsons, update_symlinks if d.getVar("CVE_CHECK_COPY_FILES") == "1": deploy_file = d.getVar("CVE_CHECK_RECIPE_FILE") |