diff options
author | Paul Eggleton <paul.eggleton@microsoft.com> | 2022-01-10 07:22:52 +1300 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.microsoft.com> | 2022-01-09 17:53:26 -0800 |
commit | 38c9e323c1429b126bba722eb0703136ee72c2fd (patch) | |
tree | 34a8b586802ced4c9e3714866964bb2d3e457b35 | |
parent | 9154f71c7267e9731156c1dfd57397103e9e6a2b (diff) | |
download | openembedded-core-contrib-paule/symlinks-fix.tar.gz |
classes/create-spdx: handle if IMAGE_LINK_NAME is emptypaule/symlinks-fix
If IMAGE_LINK_NAME is set to "" (supported in other classes) then skip
creating symlinks for the spdx manifest files.
Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com>
-rw-r--r-- | meta/classes/create-spdx.bbclass | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass index 0a4db80aba..e44a204a8f 100644 --- a/meta/classes/create-spdx.bbclass +++ b/meta/classes/create-spdx.bbclass @@ -870,8 +870,9 @@ python image_combine_spdx() { with image_spdx_path.open("wb") as f: doc.to_json(f, sort_keys=True) - image_spdx_link = imgdeploydir / (image_link_name + ".spdx.json") - image_spdx_link.symlink_to(os.path.relpath(image_spdx_path, image_spdx_link.parent)) + if image_link_name: + image_spdx_link = imgdeploydir / (image_link_name + ".spdx.json") + image_spdx_link.symlink_to(os.path.relpath(image_spdx_path, image_spdx_link.parent)) num_threads = int(d.getVar("BB_NUMBER_THREADS")) @@ -942,8 +943,9 @@ python image_combine_spdx() { tar.addfile(info, fileobj=index_str) def make_image_link(target_path, suffix): - link = imgdeploydir / (image_link_name + suffix) - link.symlink_to(os.path.relpath(target_path, link.parent)) + if image_link_name: + link = imgdeploydir / (image_link_name + suffix) + link.symlink_to(os.path.relpath(target_path, link.parent)) make_image_link(spdx_tar_path, ".spdx.tar.zst") |