summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2022-08-11 14:35:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-14 08:13:32 +0100
commita9e80e935c4734f498bd37d58abb4af4418cdc2f (patch)
tree648973506dc12a09bc0579cb5d6222d2822cd795
parentbd0beddcb1f1cfb87c245d8d6e61413ec05c67b7 (diff)
downloadpoky-a9e80e935c4734f498bd37d58abb4af4418cdc2f.tar.gz
create-spdx: handle links to inaccessible locations
When a link is pointing to location inaccessible to build user (e.g. "/root/something"), filepath.is_file() throws "PermissionError: [Errno 13] Permission denied". Fix this by first checking if it is a link. (From OE-Core rev: e105befbe4ee0d85e94c2048a744f0373e2dbcdf) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/create-spdx.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass
index 383ca10bab..47dd12c383 100644
--- a/meta/classes/create-spdx.bbclass
+++ b/meta/classes/create-spdx.bbclass
@@ -218,7 +218,7 @@ def add_package_files(d, doc, spdx_pkg, topdir, get_spdxid, get_types, *, archiv
218 filepath = Path(subdir) / file 218 filepath = Path(subdir) / file
219 filename = str(filepath.relative_to(topdir)) 219 filename = str(filepath.relative_to(topdir))
220 220
221 if filepath.is_file() and not filepath.is_symlink(): 221 if not filepath.is_symlink() and filepath.is_file():
222 spdx_file = oe.spdx.SPDXFile() 222 spdx_file = oe.spdx.SPDXFile()
223 spdx_file.SPDXID = get_spdxid(file_counter) 223 spdx_file.SPDXID = get_spdxid(file_counter)
224 for t in get_types(filepath): 224 for t in get_types(filepath):