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.

(From OE-Core rev: 5262f9bbf86c4e529ff988d465ddad2d1db0b073)

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Mark Hatle
2024-07-24 18:39:17 -05:00
committed by Richard Purdie
parent 09b49a35e1
commit 0328f2a585

View File

@@ -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