mirror of
https://git.yoctoproject.org/poky
synced 2026-04-17 18:32:12 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
bd0beddcb1
commit
a9e80e935c
@@ -218,7 +218,7 @@ def add_package_files(d, doc, spdx_pkg, topdir, get_spdxid, get_types, *, archiv
|
||||
filepath = Path(subdir) / file
|
||||
filename = str(filepath.relative_to(topdir))
|
||||
|
||||
if filepath.is_file() and not filepath.is_symlink():
|
||||
if not filepath.is_symlink() and filepath.is_file():
|
||||
spdx_file = oe.spdx.SPDXFile()
|
||||
spdx_file.SPDXID = get_spdxid(file_counter)
|
||||
for t in get_types(filepath):
|
||||
|
||||
Reference in New Issue
Block a user