mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
spdx30: test the existence of directory before walking
Due to commit [spdx30: Improve os.walk() handling][1] applied, it reported an error if walk directory failed While SPDX_INCLUDE_SOURCES = "1", if recipe does not provide sysroots, the walk in function add_package_files is broken $ echo 'SPDX_INCLUDE_SOURCES = "1"' >> conf/local.conf $ bitbake packagegroup-core-boot |DEBUG: Adding sysroot files to SPDX |ERROR: packagegroup-core-boot-1.0-r0 do_create_spdx: ERROR walking tmp/sysroots-components/intel_x86_64/packagegroup-core-boot: [Errno 2] | No such file or directory: 'tmp/sysroots-components/intel_x86_64/packagegroup-core-boot' Test the existence of directory before walking [1] https://git.openembedded.org/openembedded-core/commit/?id=86b581e80637cd8136ce7a7e95db94d9553d2f60 (From OE-Core rev: cb1792e4950d5075be9bbe4c5337a5215db9669e) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -152,6 +152,10 @@ def add_package_files(
|
|||||||
spdx_files = set()
|
spdx_files = set()
|
||||||
|
|
||||||
file_counter = 1
|
file_counter = 1
|
||||||
|
if not os.path.exists(topdir):
|
||||||
|
bb.note(f"Skip {topdir}")
|
||||||
|
return spdx_files
|
||||||
|
|
||||||
for subdir, dirs, files in os.walk(topdir, onerror=walk_error):
|
for subdir, dirs, files in os.walk(topdir, onerror=walk_error):
|
||||||
dirs[:] = [d for d in dirs if d not in ignore_dirs]
|
dirs[:] = [d for d in dirs if d not in ignore_dirs]
|
||||||
if subdir == str(topdir):
|
if subdir == str(topdir):
|
||||||
|
|||||||
Reference in New Issue
Block a user