cve-check.bbclass: Fix symlink handling also for text files

While backporting commit 7543e4e24a ("cve-check.bbclass: Mitigate
symlink related error") I failed to address the fact that in Scarthgap
this bbclass still generates also the text CVE file, in addition to the
JSON file.

In order to avoid the error that occurred with JSON files from
occurring now with CVE files:

  ERROR: core-image-base-1.0-r0 do_image_complete: Recipe core-image-base is trying to install files into a shared area when those files already exist. The files and the manifests listing them are:
    /home/poky/build/tmp/deploy/images/qemux86-64/.cve
      (matched in manifest-qemux86_64-core-image-minimal.image_complete)
  Please adjust the recipes so only one recipe provides a given file.

update the symlink handling for the text file variant too.

(From OE-Core rev: 81e702c85c62782dbedd5ca2a5e6569e6339dd60)

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Niko Mauno 2025-05-12 15:52:28 +00:00 committed by Steve Sakoman
parent 8940ebb70a
commit 848da2f632

View File

@ -270,13 +270,14 @@ python cve_check_write_rootfs_manifest () {
d.setVar("PN", save_pn)
if enable_text:
link_path = os.path.join(deploy_dir, "%s.cve" % link_name)
manifest_name = d.getVar("CVE_CHECK_MANIFEST")
with open(manifest_name, "w") as f:
f.write(text_data)
update_symlinks(manifest_name, link_path)
if link_name:
link_path = os.path.join(deploy_dir, "%s.cve" % link_name)
update_symlinks(manifest_name, link_path)
bb.plain("Image CVE report stored in: %s" % manifest_name)
if enable_json: