diff options
author | Paul Eggleton <paul.eggleton@microsoft.com> | 2022-01-09 17:54:49 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-11 15:48:11 +0000 |
commit | 0071d909a589fef769f0067cbdb3c9e8b124f207 (patch) | |
tree | 6b71fdfc92e04626f9193d430bfd26e9204a30f5 /meta/classes/create-spdx.bbclass | |
parent | 42e73db4c98b5aa9a525f51a8cd1769362b418fc (diff) | |
download | poky-0071d909a589fef769f0067cbdb3c9e8b124f207.tar.gz |
classes/create-spdx: handle if IMAGE_LINK_NAME is empty
If IMAGE_LINK_NAME is set to "" (supported in other classes) then skip
creating symlinks for the spdx manifest files.
(From OE-Core rev: c2d5e2dbbba78d8d7036f6418360b2e84bcdc169)
Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/create-spdx.bbclass')
-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() { | |||
870 | with image_spdx_path.open("wb") as f: | 870 | with image_spdx_path.open("wb") as f: |
871 | doc.to_json(f, sort_keys=True) | 871 | doc.to_json(f, sort_keys=True) |
872 | 872 | ||
873 | image_spdx_link = imgdeploydir / (image_link_name + ".spdx.json") | 873 | if image_link_name: |
874 | image_spdx_link.symlink_to(os.path.relpath(image_spdx_path, image_spdx_link.parent)) | 874 | image_spdx_link = imgdeploydir / (image_link_name + ".spdx.json") |
875 | image_spdx_link.symlink_to(os.path.relpath(image_spdx_path, image_spdx_link.parent)) | ||
875 | 876 | ||
876 | num_threads = int(d.getVar("BB_NUMBER_THREADS")) | 877 | num_threads = int(d.getVar("BB_NUMBER_THREADS")) |
877 | 878 | ||
@@ -942,8 +943,9 @@ python image_combine_spdx() { | |||
942 | tar.addfile(info, fileobj=index_str) | 943 | tar.addfile(info, fileobj=index_str) |
943 | 944 | ||
944 | def make_image_link(target_path, suffix): | 945 | def make_image_link(target_path, suffix): |
945 | link = imgdeploydir / (image_link_name + suffix) | 946 | if image_link_name: |
946 | link.symlink_to(os.path.relpath(target_path, link.parent)) | 947 | link = imgdeploydir / (image_link_name + suffix) |
948 | link.symlink_to(os.path.relpath(target_path, link.parent)) | ||
947 | 949 | ||
948 | make_image_link(spdx_tar_path, ".spdx.tar.zst") | 950 | make_image_link(spdx_tar_path, ".spdx.tar.zst") |
949 | 951 | ||