From: Mark Hatle Date: Wed, 24 Jul 2024 23:39:17 +0000 (-0500) Subject: spdx30_tasks.py: switch from exists to isfile checking debugsrc X-Git-Tag: yocto-5.1~480 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5262f9bbf86c4e529ff988d465ddad2d1db0b073;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git spdx30_tasks.py: switch from exists to isfile checking debugsrc Same change as previously made to the create-spdx-2.2.bbclass, while debugsrc is almost always a file (or link), there are apparently cases where a directory could be returned from the dwarfsrcfiles processing. When this happens, the hashing fails and an error results when building the SPDX documents. Signed-off-by: Mark Hatle Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py index 7baa6be70e3..9d5bbadc0f4 100644 --- a/meta/lib/oe/spdx30_tasks.py +++ b/meta/lib/oe/spdx30_tasks.py @@ -238,7 +238,8 @@ def get_package_sources_from_debug( if file_sha256 is None: continue else: - if not debugsrc_path.exists(): + # We can only hash files below, skip directories, links, etc. + if not debugsrc_path.isfile(): source_hash_cache[debugsrc_path] = None continue