]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
spdx30: test the existence of directory before walking
authorhongxu <hongxu.jia@eng.windriver.com>
Tue, 18 Mar 2025 11:32:54 +0000 (19:32 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 19 Mar 2025 09:47:35 +0000 (09:47 +0000)
commitcb1792e4950d5075be9bbe4c5337a5215db9669e
tree57fd5e829af3c3314151a594b37fefb0eca019f6
parent6f6d57842f3c0dddd9c563305a693cacee9e72f8
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

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/spdx30_tasks.py