diff options
author | Mark Hatle <mark.hatle@amd.com> | 2024-07-15 14:56:06 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-07-18 17:21:39 +0100 |
commit | a798d00d54a1424f9972de43ff05a0ca8950d7de (patch) | |
tree | def60a853ef8a6619355e94c9f4625340cd27980 /meta/classes | |
parent | 23e4ffef1164e7eb4a569608d00d4eaeadad047c (diff) | |
download | poky-a798d00d54a1424f9972de43ff05a0ca8950d7de.tar.gz |
create-sdpx-2.2.bbclass: Switch from exists to isfile checking debugsrc
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: 02e262c291c0b2066132b4cb2ca5fda8145284a9)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/create-spdx-2.2.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index 865323d66a..12b78cb3f6 100644 --- a/meta/classes/create-spdx-2.2.bbclass +++ b/meta/classes/create-spdx-2.2.bbclass | |||
@@ -230,7 +230,8 @@ def add_package_sources_from_debug(d, package_doc, spdx_package, package, packag | |||
230 | debugsrc_path = search / debugsrc.replace('/usr/src/kernel/', '') | 230 | debugsrc_path = search / debugsrc.replace('/usr/src/kernel/', '') |
231 | else: | 231 | else: |
232 | debugsrc_path = search / debugsrc.lstrip("/") | 232 | debugsrc_path = search / debugsrc.lstrip("/") |
233 | if not debugsrc_path.exists(): | 233 | # We can only hash files below, skip directories, links, etc. |
234 | if not os.path.isfile(debugsrc_path): | ||
234 | continue | 235 | continue |
235 | 236 | ||
236 | file_sha256 = bb.utils.sha256_file(debugsrc_path) | 237 | file_sha256 = bb.utils.sha256_file(debugsrc_path) |